diff --git a/ext/fetch/22_body.js b/ext/fetch/22_body.js index e9d4936586..82f41411d8 100644 --- a/ext/fetch/22_body.js +++ b/ext/fetch/22_body.js @@ -196,10 +196,23 @@ class InnerBody { * @returns {InnerBody} */ clone() { - const { 0: out1, 1: out2 } = readableStreamTee(this.stream, true); - this.streamOrStatic = out1; - const second = new InnerBody(out2); - second.source = core.deserialize(core.serialize(this.source)); + let second; + if ( + !ObjectPrototypeIsPrototypeOf( + ReadableStreamPrototype, + this.streamOrStatic, + ) && !this.streamOrStatic.consumed + ) { + second = new InnerBody({ + body: this.streamOrStatic.body, + consumed: false, + }); + } else { + const { 0: out1, 1: out2 } = readableStreamTee(this.stream, true); + this.streamOrStatic = out1; + second = new InnerBody(out2); + } + second.source = this.source; second.length = this.length; return second; }