@@ -1529,7 +1529,7 @@ return /******/ (function(modules) { // webpackBootstrap
1529
1529
} ;
1530
1530
1531
1531
// decode payload
1532
- parser . decodePayload ( data , this . socket . binaryType , callback ) ;
1532
+ parser . decodePayload ( data , this . socket . binaryType , this . supportsBinary , callback ) ;
1533
1533
1534
1534
// if an event did not trigger closing
1535
1535
if ( 'closed' !== this . readyState ) {
@@ -2166,7 +2166,7 @@ return /******/ (function(modules) { // webpackBootstrap
2166
2166
* @api public
2167
2167
*/
2168
2168
2169
- exports . decodePayload = function ( data , binaryType , callback ) {
2169
+ exports . decodePayload = function ( data , binaryType , utf8decode , callback ) {
2170
2170
if ( typeof data !== 'string' ) {
2171
2171
return exports . decodePayloadAsBinary ( data , binaryType , callback ) ;
2172
2172
}
@@ -2176,12 +2176,24 @@ return /******/ (function(modules) { // webpackBootstrap
2176
2176
binaryType = null ;
2177
2177
}
2178
2178
2179
+ if ( typeof utf8decode === 'function' ) {
2180
+ callback = utf8decode ;
2181
+ utf8decode = null ;
2182
+ }
2183
+
2179
2184
var packet ;
2180
2185
if ( data === '' ) {
2181
2186
// parser error - ignoring payload
2182
2187
return callback ( err , 0 , 1 ) ;
2183
2188
}
2184
2189
2190
+ if ( utf8decode ) {
2191
+ data = tryDecode ( data ) ;
2192
+ if ( data === false ) {
2193
+ return callback ( err , 0 , 1 ) ;
2194
+ }
2195
+ }
2196
+
2185
2197
var length = '' , n , msg ;
2186
2198
2187
2199
for ( var i = 0 , l = data . length ; i < l ; i ++ ) {
0 commit comments