Skip to content

Commit 338187c

Browse files
committed
Clean up some admin server failure case behaviour
1 parent 68b41a6 commit 338187c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/admin-server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export class AdminServer {
5454
stream.respond({ ':status': 400 });
5555
stream.end();
5656
adminSession.close();
57+
return;
5758
}
5859
try {
5960
adminSession = await this.handleStartRequest(stream, session);
@@ -67,6 +68,7 @@ export class AdminServer {
6768
} else if (!adminSession) {
6869
console.log(`${headers[':path']} request on an admin stream before /start`)
6970
stream.respond({ ':status': 400 });
71+
stream.end();
7072
return;
7173
} else if (headers[':path']?.startsWith('/request/')) {
7274
const requestId = headers[':path'].slice('/request/'.length);
@@ -106,6 +108,7 @@ export class AdminServer {
106108

107109
if (firstCommand.command !== 'auth') {
108110
stream.end(JSON.stringify({ error: 'Auth required' }));
111+
return;
109112
}
110113

111114
const endpointId = generateEndpointId();

0 commit comments

Comments
 (0)