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.
This commit is contained in:
Andreu Botella 2021-06-23 16:00:23 +02:00 committed by GitHub
parent 2c4ce26f0b
commit edab21ebab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 19 deletions

View file

@ -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,