diff options
author | Satya Rohith <me@satyarohith.com> | 2024-08-08 12:22:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-08 10:22:58 +0000 |
commit | 65224786d2661fc9d1c42fba17d66079600db6ad (patch) | |
tree | a31e8b46af7b8a65bdeafb83e9e1152d66417ce3 /ext/node/polyfills/http.ts | |
parent | 733162a83eb0808d593ceadbf15bb3490cc1aa15 (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/polyfills/http.ts')
-rw-r--r-- | ext/node/polyfills/http.ts | 4 |
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: |