From: Jérôme Benoit Date: Sun, 4 Sep 2022 12:43:50 +0000 (+0200) Subject: WS UI Server: do not crash the server at authentication error X-Git-Tag: v1.1.70~8 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4055bcb98b38568fdd77461842820e7d1a86f419;p=e-mobility-charging-stations-simulator.git WS UI Server: do not crash the server at authentication error Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ui-server/UIWebSocketServer.ts b/src/charging-station/ui-server/UIWebSocketServer.ts index f7a0379d..01c57800 100644 --- a/src/charging-station/ui-server/UIWebSocketServer.ts +++ b/src/charging-station/ui-server/UIWebSocketServer.ts @@ -72,7 +72,7 @@ export default class UIWebSocketServer extends AbstractUIServer { this.authenticate(req, (err) => { if (err) { socket.write(`HTTP/1.1 ${StatusCodes.UNAUTHORIZED} Unauthorized\r\n\r\n`); - socket.destroy(err); + socket.destroy(); return; } this.webSocketServer.handleUpgrade(req, socket, head, (ws: WebSocket) => {