Skip to content

Commit 4c021d3

Browse files
[chore] Release 2.1.1 (#556)
1 parent 56bf176 commit 4c021d3

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

History.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
2.1.1 / 2017-03-22
3+
===================
4+
5+
* [chore] Bump engine.io-parser to version 2.0.2 (#555)
6+
27
2.1.0 / 2017-03-11
38
===================
49

engine.io.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ return /******/ (function(modules) { // webpackBootstrap
15291529
};
15301530

15311531
// decode payload
1532-
parser.decodePayload(data, this.socket.binaryType, callback);
1532+
parser.decodePayload(data, this.socket.binaryType, this.supportsBinary, callback);
15331533

15341534
// if an event did not trigger closing
15351535
if ('closed' !== this.readyState) {
@@ -2166,7 +2166,7 @@ return /******/ (function(modules) { // webpackBootstrap
21662166
* @api public
21672167
*/
21682168

2169-
exports.decodePayload = function (data, binaryType, callback) {
2169+
exports.decodePayload = function (data, binaryType, utf8decode, callback) {
21702170
if (typeof data !== 'string') {
21712171
return exports.decodePayloadAsBinary(data, binaryType, callback);
21722172
}
@@ -2176,12 +2176,24 @@ return /******/ (function(modules) { // webpackBootstrap
21762176
binaryType = null;
21772177
}
21782178

2179+
if (typeof utf8decode === 'function') {
2180+
callback = utf8decode;
2181+
utf8decode = null;
2182+
}
2183+
21792184
var packet;
21802185
if (data === '') {
21812186
// parser error - ignoring payload
21822187
return callback(err, 0, 1);
21832188
}
21842189

2190+
if (utf8decode) {
2191+
data = tryDecode(data);
2192+
if (data === false) {
2193+
return callback(err, 0, 1);
2194+
}
2195+
}
2196+
21852197
var length = '', n, msg;
21862198

21872199
for (var i = 0, l = data.length; i < l; i++) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "engine.io-client",
33
"description": "Client for the realtime Engine",
44
"license": "MIT",
5-
"version": "2.1.0",
5+
"version": "2.1.1",
66
"homepage": "https://github.com/socketio/engine.io-client",
77
"contributors": [
88
{
@@ -45,7 +45,7 @@
4545
"concat-stream": "1.5.2",
4646
"del": "2.2.0",
4747
"derequire": "1.2.0",
48-
"engine.io": "2.1.0",
48+
"engine.io": "2.1.1",
4949
"eslint-config-standard": "4.4.0",
5050
"eslint-plugin-standard": "1.3.1",
5151
"expect.js": "0.2.0",

0 commit comments

Comments
 (0)