summaryrefslogtreecommitdiff
path: root/extensions/web/06_streams.js
diff options
context:
space:
mode:
authorAndreu Botella <abb@randomunok.com>2021-06-23 16:00:23 +0200
committerGitHub <noreply@github.com>2021-06-23 16:00:23 +0200
commitedab21ebab3daa3cb0ebd5f6fca60c17098df242 (patch)
tree601557d2ff77687acc5b883201a7fbc0ce2482dd /extensions/web/06_streams.js
parent2c4ce26f0bf1bf957d5c7dec28372898c60ed66c (diff)
fix(fetch): proxy body for requests created from other requests (#11093)
Additionally, if the existing `Request`'s body is disturbed, the Request creation should fail. This change also updates the step numbers in the Request constructor to match whatwg/fetch#1249.
Diffstat (limited to 'extensions/web/06_streams.js')
-rw-r--r--extensions/web/06_streams.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/extensions/web/06_streams.js b/extensions/web/06_streams.js
index be5eca6ba..127436d43 100644
--- a/extensions/web/06_streams.js
+++ b/extensions/web/06_streams.js
@@ -4246,6 +4246,13 @@
webidl.configurePrototype(WritableStreamDefaultController);
+ /**
+ * @param {ReadableStream} stream
+ */
+ function createProxy(stream) {
+ return stream.pipeThrough(new TransformStream());
+ }
+
webidl.converters.ReadableStream = webidl
.createInterfaceConverter("ReadableStream", ReadableStream);
webidl.converters.WritableStream = webidl
@@ -4403,6 +4410,7 @@
// Non-Public
isReadableStreamDisturbed,
errorReadableStream,
+ createProxy,
// Exposed in global runtime scope
ByteLengthQueuingStrategy,
CountQueuingStrategy,