Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: terminate the process correctly #2499

Closed
wants to merge 10 commits into from
3 changes: 2 additions & 1 deletion lib/fetch/body.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ function cloneBody (body) {
const out2Clone = structuredClone(out2, { transfer: [out2] })
// This, for whatever reasons, unrefs out2Clone which allows
// the process to exit by itself.
const [, finalClone] = out2Clone.tee()
const [finalClone, final2Clone] = out2Clone.tee()
final2Clone.cancel().catch(() => null)

// 2. Set body’s stream to out1.
body.stream = out1
Expand Down
Loading