1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-25 11:43:07 +01:00

Add comment for 123 magic number

This commit is contained in:
Madeline 2022-12-17 19:50:30 +11:00
parent 1e2e82d975
commit 15090143d0

View File

@ -16,7 +16,7 @@ export async function Message(this: WebSocket, buffer: WS.Data) {
// TODO: compression
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")) {
data = bigIntJson.parse(buffer.toString());
}