Skip to content

Commit 1e303fd

Browse files
committed
Change close code for unexpected condition
1 parent e881392 commit 1e303fd

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/modules/server/api/websocket.gateway.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class WebsocketGateway implements OnModuleInit, OnModuleDestroy {
113113
}
114114

115115
if (user.room === null || user.userid === null) {
116-
ws.end(WebSocketCloseCode.PolicyViolation, 'Missing room or userid');
116+
ws.end(WebSocketCloseCode.InternalError, 'Missing room or userid');
117117

118118
return;
119119
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code
22
export enum WebSocketCloseCode {
33
InternalError = 1011,
4-
PolicyViolation = 1008,
54
Unauthorized = 4401,
65
}

0 commit comments

Comments
 (0)