From 65224786d2661fc9d1c42fba17d66079600db6ad Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Thu, 8 Aug 2024 12:22:58 +0200 Subject: fix(ext/node): client closing streaming request shouldn't terminate http server (#24946) Closes https://github.com/denoland/deno/issues/22820 --- ext/node/polyfills/http.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext/node') diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index f4126241e..e0ddedef8 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -1642,7 +1642,9 @@ export class IncomingMessageForServer extends NodeReadable { } }, destroy: (err, cb) => { - reader?.cancel().finally(() => cb(err)); + reader?.cancel().catch(() => { + // Don't throw error - it's propagated to the user via 'error' event. + }).finally(nextTick(onError, this, err, cb)); }, }); // TODO(@bartlomieju): consider more robust path extraction, e.g: -- cgit v1.2.3