summary refs log tree commit diff
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-10 04:36:41 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-10 04:36:41 +0200
commit92b4c5ca355b596f8f9618cace664840c40522bd (patch)
treefa17684e8c5ae708b50900de031625236be70a1f
parentDon't use default config as config. (diff)
downloadserver-92b4c5ca355b596f8f9618cace664840c40522bd.tar.xz
Fix heartbeat not accepting d == null
-rw-r--r--gateway/src/events/Message.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/gateway/src/events/Message.ts b/gateway/src/events/Message.ts
index 71b6f206..7ed1dd06 100644
--- a/gateway/src/events/Message.ts
+++ b/gateway/src/events/Message.ts
@@ -37,7 +37,7 @@ export async function Message(this: WebSocket, buffer: WS.RawData) {
 	if(data.op !== 1)
 		check.call(this, PayloadSchema, data);
 	else { //custom validation for numbers, because heartbeat
-		if(data.s || data.t || typeof data.d !== "number") {
+		if(data.s || data.t || (typeof data.d !== "number" && data.d)) {
 			console.log("Invalid heartbeat...");
 			this.close(CLOSECODES.Decode_error);
 		}