From b09029d02f427733f9f847a7713a693ed44a04e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Mon, 7 Aug 2023 17:52:39 +0200 Subject: [PATCH] use correct http status code for SSE --- packages/cli/src/push/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/push/index.ts b/packages/cli/src/push/index.ts index d5225b34893a9..752f90e5a977b 100644 --- a/packages/cli/src/push/index.ts +++ b/packages/cli/src/push/index.ts @@ -26,7 +26,7 @@ export class Push extends EventEmitter { } else if (!useWebSockets) { (this.backend as SSEPush).add(req.query.sessionId, { req, res }); } else { - res.status(1008).send('Unauthorized'); + res.status(401).send('Unauthorized'); } this.emit('editorUiConnected', req.query.sessionId); } @@ -88,7 +88,7 @@ export const setupPushHandler = (restEndpoint: string, app: Application) => { ws.send(`Unauthorized: ${(error as Error).message}`); ws.close(1008); } else { - res.status(1008).send('Unauthorized'); + res.status(401).send('Unauthorized'); } return; }