mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
fix: allow objects with a null prototype in binary packets (#114)
This commit is contained in:
@@ -14,6 +14,21 @@ describe("parser", () => {
|
||||
helpers.test_bin(packet, done);
|
||||
});
|
||||
|
||||
it("encodes an ArrayBuffer into an object with a null prototype", (done) => {
|
||||
const packet = {
|
||||
type: PacketType.EVENT,
|
||||
data: [
|
||||
"a",
|
||||
Object.create(null, {
|
||||
array: { value: new ArrayBuffer(2), enumerable: true },
|
||||
}),
|
||||
],
|
||||
id: 0,
|
||||
nsp: "/",
|
||||
};
|
||||
helpers.test_bin(packet, done);
|
||||
});
|
||||
|
||||
it("encodes a TypedArray", (done) => {
|
||||
const array = new Uint8Array(5);
|
||||
for (let i = 0; i < array.length; i++) array[i] = i;
|
||||
|
||||
Reference in New Issue
Block a user