diff --git a/packages/cli/src/push/index.ts b/packages/cli/src/push/index.ts index 09af08799d..d5225b3489 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(401).send('Unauthorized'); + res.status(1008).send('Unauthorized'); } this.emit('editorUiConnected', req.query.sessionId); } @@ -73,7 +73,7 @@ export const setupPushHandler = (restEndpoint: string, app: Application) => { if (sessionId === undefined) { if (ws) { ws.send('The query parameter "sessionId" is missing!'); - ws.close(400); + ws.close(1008); } else { next(new Error('The query parameter "sessionId" is missing!')); } @@ -86,9 +86,9 @@ export const setupPushHandler = (restEndpoint: string, app: Application) => { } catch (error) { if (ws) { ws.send(`Unauthorized: ${(error as Error).message}`); - ws.close(401); + ws.close(1008); } else { - res.status(401).send('Unauthorized'); + res.status(1008).send('Unauthorized'); } return; }