socket.io-parser
Advanced tools
Comparing version 4.0.4 to 4.0.5
@@ -64,4 +64,12 @@ "use strict"; | ||
return data; | ||
if (data && data._placeholder) { | ||
return buffers[data.num]; // appropriate buffer (should be natural order anyway) | ||
if (data && data._placeholder === true) { | ||
const 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"); | ||
} | ||
} | ||
@@ -68,0 +76,0 @@ else if (Array.isArray(data)) { |
@@ -105,2 +105,5 @@ "use strict"; | ||
if (typeof obj === "string") { | ||
if (this.reconstructor) { | ||
throw new Error("got plaintext data when reconstructing a packet"); | ||
} | ||
packet = this.decodeString(obj); | ||
@@ -107,0 +110,0 @@ if (packet.type === PacketType.BINARY_EVENT || |
{ | ||
"name": "socket.io-parser", | ||
"version": "4.0.4", | ||
"version": "4.0.5", | ||
"description": "socket.io protocol parser", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
525
21098
9