[whatwg/fetch] Type confusion in Request constructor leading to underdefined behavior (#483)

https://fetch.spec.whatwg.org/#dom-request step 28 says:

> Let _headers_ be a copy of r’s Headers object and its associated header list.

OK, so _headers_ is a Headers object.

Step 29 says:

> If _init_’s `headers` member is present, set _headers_ to init’s `headers` member.

Let's say it's not present.

Step 32 says: 

> Fill _r_’s Headers object with _headers_. Rethrow any exceptions.

with a link to <https://fetch.spec.whatwg.org/#concept-headers-fill>.

But that algorithm expects the input to be a sequence or a record, and it's neither: it's a Headers.  Yes, you can create a sequence from a Headers by round-tripping through to-JS and from-JS conversion, but if that's the expectation that needs to be clearly spelled out here, because that's obviously observably different from just copying over the things from the Headers instance that was passed in.




-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/483

Received on Tuesday, 7 February 2017 15:00:34 UTC