summaryrefslogtreecommitdiff
path: root/ext/node
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2024-08-08 12:22:58 +0200
committerGitHub <noreply@github.com>2024-08-08 10:22:58 +0000
commit65224786d2661fc9d1c42fba17d66079600db6ad (patch)
treea31e8b46af7b8a65bdeafb83e9e1152d66417ce3 /ext/node
parent733162a83eb0808d593ceadbf15bb3490cc1aa15 (diff)
fix(ext/node): client closing streaming request shouldn't terminate http server (#24946)
Closes https://github.com/denoland/deno/issues/22820
Diffstat (limited to 'ext/node')
-rw-r--r--ext/node/polyfills/http.ts4
1 files changed, 3 insertions, 1 deletions
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: