Kept internal under SECURITY.md until the other four are fixed, since it can also take the process down.
The Node request listener (src/http/server.ts:99) is async, and a failure from dispatch, for example a custom opts.static resolver that rejects (src/http/core.ts:166), is not caught. Node's default for an unhandled rejection is to exit.
Fix: catch at the listener boundary, log the error, and answer 500 when headers have not been sent. Test: a resolver that throws gives a 500, and the server keeps serving.
Kept internal under SECURITY.md until the other four are fixed, since it can also take the process down.
The Node request listener (src/http/server.ts:99) is `async`, and a failure from dispatch, for example a custom `opts.static` resolver that rejects (src/http/core.ts:166), is not caught. Node's default for an unhandled rejection is to exit.
**Fix:** catch at the listener boundary, log the error, and answer 500 when headers have not been sent. **Test:** a resolver that throws gives a 500, and the server keeps serving.
Fixed in 26.11.0-rc.1 (8b67b1a, 1069c72). From the changelog:
A request that fails past the error renderer no longer takes the Node process down (#108). The Node request listener was an async function, and http.createServer ignores the promise it returns, so anything that rejected outside the region where errors convert to a response — a custom static resolver, a handler header value Node refuses to write, a stream that fails before its first frame — became an unhandled rejection, which Node's default mode turns into an exit. The listener now catches it. While the response is still writable the client gets a fixed 500 with connection: close, written without calling onError again; once output has started the socket is destroyed instead. Either way the failure is logged through logger.error. No request:end is emitted for these requests. Deno, Bun and the edge were not affected: they receive app.fetch's promise, and the runtime answers a rejection with a 500 itself.
Fixed in **26.11.0-rc.1** (`8b67b1a`, `1069c72`). From the changelog:
- **A request that fails past the error renderer no longer takes the Node process down** (#108). The Node request listener was an `async` function, and `http.createServer` ignores the promise it returns, so anything that rejected outside the region where errors convert to a response — a custom static resolver, a handler header value Node refuses to write, a stream that fails before its first frame — became an unhandled rejection, which Node's default mode turns into an exit. The listener now catches it. While the response is still writable the client gets a fixed 500 with `connection: close`, written without calling `onError` again; once output has started the socket is destroyed instead. Either way the failure is logged through `logger.error`. No `request:end` is emitted for these requests. Deno, Bun and the edge were not affected: they receive `app.fetch`'s promise, and the runtime answers a rejection with a 500 itself.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Kept internal under SECURITY.md until the other four are fixed, since it can also take the process down.
The Node request listener (src/http/server.ts:99) is
async, and a failure from dispatch, for example a customopts.staticresolver that rejects (src/http/core.ts:166), is not caught. Node's default for an unhandled rejection is to exit.Fix: catch at the listener boundary, log the error, and answer 500 when headers have not been sent. Test: a resolver that throws gives a 500, and the server keeps serving.
Fixed in 26.11.0-rc.1 (
8b67b1a,1069c72). From the changelog:asyncfunction, andhttp.createServerignores the promise it returns, so anything that rejected outside the region where errors convert to a response — a custom static resolver, a handler header value Node refuses to write, a stream that fails before its first frame — became an unhandled rejection, which Node's default mode turns into an exit. The listener now catches it. While the response is still writable the client gets a fixed 500 withconnection: close, written without callingonErroragain; once output has started the socket is destroyed instead. Either way the failure is logged throughlogger.error. Norequest:endis emitted for these requests. Deno, Bun and the edge were not affected: they receiveapp.fetch's promise, and the runtime answers a rejection with a 500 itself.