summaryrefslogtreecommitdiff
path: root/ext/web
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2024-09-16 14:23:40 +0200
committerGitHub <noreply@github.com>2024-09-16 14:23:40 +0200
commit74069add3f400ad6b232ad18840206ab96b9fe80 (patch)
tree8823267812b6e4b683cc9f48431b866f9a276549 /ext/web
parentf8547e2617a5bbef4931ac0df6e70db6b901927f (diff)
fix(runtime): don't error `child.output()` on consumed stream (#25657)
This fixes the fast path for `readableStreamCollectIntoUint8Array` to only trigger if the readable stream has not yet been disturbed - because otherwise we may not be able to close it if the read errors.
Diffstat (limited to 'ext/web')
-rw-r--r--ext/web/06_streams.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js
index 1dbf769b2..a4f2275c5 100644
--- a/ext/web/06_streams.js
+++ b/ext/web/06_streams.js
@@ -1054,7 +1054,7 @@ async function readableStreamCollectIntoUint8Array(stream) {
getReadableStreamResourceBackingUnrefable(stream);
const reader = acquireReadableStreamDefaultReader(stream);
- if (resourceBacking) {
+ if (resourceBacking && !isReadableStreamDisturbed(stream)) {
// fast path, read whole body in a single op call
try {
readableStreamDisturb(stream);