Skip to content

Commit

Permalink
fix: http_server_native to close ReadableStream on abort signal
Browse files Browse the repository at this point in the history
  • Loading branch information
Thesephi authored Dec 3, 2024
1 parent 26ae6bd commit 6538aab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions http_server_native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ export class Server<AS extends State = Record<string, any>>
signal,
...options,
});
// closinng stream, so that the Application listen promise can resolve itself
// https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/close
signal?.addEventListener("abort", () => controller.close(), { once: true });
},
});

Expand Down

0 comments on commit 6538aab

Please sign in to comment.