mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
fix(ext/fetch): Body#bodyUsed
for static body (#16080)
This fixes a bug where `Body#bodyUsed` incorrectly returns `false` for a body that has actually already been consumed, after `Body#body` is called.
This commit is contained in:
parent
15ea624790
commit
927f4e2e83
3 changed files with 24 additions and 0 deletions
|
@ -28,6 +28,8 @@
|
|||
const {
|
||||
isReadableStreamDisturbed,
|
||||
errorReadableStream,
|
||||
readableStreamClose,
|
||||
readableStreamDisturb,
|
||||
createProxy,
|
||||
ReadableStreamPrototype,
|
||||
} = globalThis.__bootstrap.streams;
|
||||
|
@ -92,6 +94,8 @@
|
|||
if (consumed) {
|
||||
this.streamOrStatic = new ReadableStream();
|
||||
this.streamOrStatic.getReader();
|
||||
readableStreamDisturb(this.streamOrStatic);
|
||||
readableStreamClose(this.streamOrStatic);
|
||||
} else {
|
||||
this.streamOrStatic = new ReadableStream({
|
||||
start(controller) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue