Files
socket.io/test/arraybuffer.js
Arnau Fugarolas Barbena ee00660749 fix: check the format of the event name (#125)
A packet like '2[{"toString":"foo"}]' was decoded as:

{
  type: EVENT,
  data: [ { "toString": "foo" } ]
}

Which would then throw an error when passed to the EventEmitter class:

> TypeError: Cannot convert object to primitive value
>    at Socket.emit (node:events:507:25)
>    at .../node_modules/socket.io/lib/socket.js:531:14

Backported from 3b78117bf6
2024-07-22 11:05:42 +02:00

1.9 KiB