diff --git a/lib/fetch/body.js b/lib/fetch/body.js index 16914c14c8f..985f9909c74 100644 --- a/lib/fetch/body.js +++ b/lib/fetch/body.js @@ -274,17 +274,13 @@ function cloneBody (body) { // 1. Let « out1, out2 » be the result of teeing body’s stream. const [out1, out2] = body.stream.tee() - const out2Clone = structuredClone(out2, { transfer: [out2] }) - // This, for whatever reasons, unrefs out2Clone which allows - // the process to exit by itself. - const [, finalClone] = out2Clone.tee() // 2. Set body’s stream to out1. body.stream = out1 // 3. Return a body whose stream is out2 and other members are copied from body. return { - stream: finalClone, + stream: out2, length: body.length, source: body.source } diff --git a/test/mock-interceptor-unused-assertions.js b/test/mock-interceptor-unused-assertions.js index 120a2ddedba..2fe8b824f9f 100644 --- a/test/mock-interceptor-unused-assertions.js +++ b/test/mock-interceptor-unused-assertions.js @@ -7,7 +7,7 @@ const util = require('../lib/core/util') // Since Node.js v21 `console.table` rows are aligned to the left // https://github.com/nodejs/node/pull/50135 -const tableRowsAlignedToLeft = util.nodeMajor >= 21 +const tableRowsAlignedToLeft = util.nodeMajor >= 21 || (util.nodeMajor === 20 && util.nodeMinor >= 11) // Avoid colors in the output for inline snapshots. const pendingInterceptorsFormatter = new PendingInterceptorsFormatter({ disableColors: true })