diff --git a/extensions/fetch/22_body.js b/extensions/fetch/22_body.js index 9b5bf8eff4..c683ca14fd 100644 --- a/extensions/fetch/22_body.js +++ b/extensions/fetch/22_body.js @@ -41,14 +41,16 @@ get stream() { if (!(this.streamOrStatic instanceof ReadableStream)) { const { body, consumed } = this.streamOrStatic; - this.streamOrStatic = new ReadableStream({ - start(controller) { - controller.enqueue(body); - controller.close(); - }, - }); if (consumed) { - this.streamOrStatic.cancel(); + this.streamOrStatic = new ReadableStream(); + this.streamOrStatic.getReader(); + } else { + this.streamOrStatic = new ReadableStream({ + start(controller) { + controller.enqueue(body); + controller.close(); + }, + }); } } return this.streamOrStatic;