engine.io-parser
Advanced tools
Comparing version 2.0.1 to 2.0.2
2.0.2 / 2017-03-21 | ||
================== | ||
* [fix] Enable to utf8-decode string payloads (#88) | ||
2.0.1 / 2017-03-06 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -372,3 +372,3 @@ /** | ||
exports.decodePayload = function (data, binaryType, callback) { | ||
exports.decodePayload = function (data, binaryType, utf8decode, callback) { | ||
if (typeof data !== 'string') { | ||
@@ -383,2 +383,7 @@ return exports.decodePayloadAsBinary(data, binaryType, callback); | ||
if (typeof utf8decode === 'function') { | ||
callback = utf8decode; | ||
utf8decode = null; | ||
} | ||
var packet; | ||
@@ -390,2 +395,9 @@ if (data === '') { | ||
if (utf8decode) { | ||
data = tryDecode(data); | ||
if (data === false) { | ||
return callback(err, 0, 1); | ||
} | ||
} | ||
var length = '', n, msg; | ||
@@ -392,0 +404,0 @@ |
@@ -268,3 +268,3 @@ /** | ||
exports.decodePayload = function (data, binaryType, callback) { | ||
exports.decodePayload = function (data, binaryType, utf8decode, callback) { | ||
if (typeof data !== 'string') { | ||
@@ -279,2 +279,7 @@ return exports.decodePayloadAsBinary(data, binaryType, callback); | ||
if (typeof utf8decode === 'function') { | ||
callback = utf8decode; | ||
utf8decode = null; | ||
} | ||
if (data === '') { | ||
@@ -285,2 +290,9 @@ // parser error - ignoring payload | ||
if (utf8decode) { | ||
data = tryDecode(data); | ||
if (data === false) { | ||
return callback(err, 0, 1); | ||
} | ||
} | ||
var length = '', n, msg, packet; | ||
@@ -287,0 +299,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"homepage": "https://github.com/socketio/engine.io-parser", | ||
@@ -8,0 +8,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44912
1151