diff --git a/src/gateway/index.ts b/src/gateway/index.ts index c3e5a5e..fcc1c3f 100644 --- a/src/gateway/index.ts +++ b/src/gateway/index.ts @@ -216,7 +216,11 @@ export default function(server: Server) { break; } case GatewayPayloadType.Ping: { - // TODO: also check session here and ensure packet is sent at the right time + if (payload.d !== 0) { + return closeWithBadPayload(ws, "d: expected numeric '0'"); + } + + // TODO: also check session here ws.state.alive = true; break; }