From edab21ebab3daa3cb0ebd5f6fca60c17098df242 Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Wed, 23 Jun 2021 16:00:23 +0200 Subject: 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. --- extensions/web/06_streams.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'extensions/web/06_streams.js') 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, -- cgit v1.2.3