Skip to content

Commit

Permalink
use correct http status code for SSE
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Aug 16, 2023
1 parent e799169 commit b09029d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/push/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b09029d

Please sign in to comment.