Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow used body replacement in Request constructor
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 throws a TypeError early in Request's constructor: let request = new Request(url, { method: "POST", body: "foo" }) await request.text() // disturb the body request = new Request(request, { body: "bar" }) // throws This commit's changes allows the latter code snippet to work like the first one. Tests: web-platform-tests/wpt#9931. Fixes #674.
- Loading branch information