Currently, the following code snippet replaces request's body as one would expect: let request = new Request(url, { method: "POST", body: "foo" }) request = new Request(request, { body: "bar" }) But this snippet, in which the author tries to replace a used body, throws a TypeError: let request = new Request(url, { method: "POST", body: "foo" }) await request.text() // disturb the body request = new Request(request, { body: "bar" }) // throws Since the second snippet is providing a new body to the constructor, there doesn't seem to be any technical need to throw. I have a pull request in to change this in the Fetch spec here: https://github.com/whatwg/fetch/pull/675 Accompanying WPT PR here: https://github.com/w3c/web-platform-tests/pull/9931
<rdar://problem/49425609>
Created attachment 366323 [details] Patch
ping review?
Comment on attachment 366323 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=366323&action=review > Source/WebCore/Modules/fetch/FetchRequest.cpp:241 > + return Exception {TypeError, "Request input is disturbed or locked."_s }; s/{T/{ T/
Committed r243757: <https://trac.webkit.org/changeset/243757>