Skip to content

Commit

Permalink
fix: the server could crash if a client sends invalid frames
Browse files Browse the repository at this point in the history
Closes #290
  • Loading branch information
jonasgloning committed Nov 10, 2022
1 parent d4b292d commit 33e6d75
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/services/webSocketServer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class WebSocketServer extends EventEmitter implements IWebSocketServer {
}

private _onSocketConnection(socket: MyWebSocket, req: IncomingMessage): void {
socket.on("error", this._onSocketError);
const { query = {} } = url.parse(req.url ?? '', true);

const { id, token, key }: IAuthParams = query;
Expand Down

0 comments on commit 33e6d75

Please sign in to comment.