mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-12 21:52:40 +01:00
Add comment for 123 magic number
This commit is contained in:
parent
1e2e82d975
commit
15090143d0
@ -16,7 +16,7 @@ export async function Message(this: WebSocket, buffer: WS.Data) {
|
|||||||
// TODO: compression
|
// TODO: compression
|
||||||
var data: Payload;
|
var data: Payload;
|
||||||
|
|
||||||
if ((buffer instanceof Buffer && buffer[0] === 123) ||
|
if ((buffer instanceof Buffer && buffer[0] === 123) || // ASCII 123 = `{`. Bad check for JSON
|
||||||
(typeof buffer === "string")) {
|
(typeof buffer === "string")) {
|
||||||
data = bigIntJson.parse(buffer.toString());
|
data = bigIntJson.parse(buffer.toString());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user