socket.io-parser
Advanced tools
Comparing version 3.4.1 to 3.4.2
@@ -73,4 +73,12 @@ /*global Blob,File*/ | ||
if (data && data._placeholder) { | ||
return buffers[data.num]; // appropriate buffer (should be natural order anyway) | ||
if (data && data._placeholder === true) { | ||
var isIndexValid = | ||
typeof data.num === "number" && | ||
data.num >= 0 && | ||
data.num < buffers.length; | ||
if (isIndexValid) { | ||
return buffers[data.num]; // appropriate buffer (should be natural order anyway) | ||
} else { | ||
throw new Error("illegal attachments"); | ||
} | ||
} else if (isArray(data)) { | ||
@@ -77,0 +85,0 @@ for (var i = 0; i < data.length; i++) { |
@@ -242,2 +242,5 @@ | ||
if (typeof obj === 'string') { | ||
if (this.reconstructor) { | ||
throw new Error("got plaintext data when reconstructing a packet"); | ||
} | ||
packet = decodeString(obj); | ||
@@ -244,0 +247,0 @@ if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) { // binary packet's json |
{ | ||
"name": "socket.io-parser", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "socket.io protocol parser", | ||
@@ -33,3 +33,6 @@ "repository": { | ||
}, | ||
"license": "MIT" | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=10.0.0" | ||
} | ||
} |
17020
492
6