Add comment for 123 magic number

This commit is contained in:
Madeline
2022-12-17 19:50:30 +11:00
parent 8af99034bc
commit 9adce764e8
+1 -1
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());
}