[whatwg/fetch] Constructing a Headers from another Headers is lossy (#481)

We've changed the constructor signature to take:

    sequence<sequence<ByteString>> or record<ByteString, ByteString>

so when passing a Headers we will iterate over it, instead of just copying its list of stuff.

But iteration over headers is specced to run through https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine which means it will reorder the headers, combine them from multiple header lines to one line, and so forth.  This process is lossy and the result may well behave differently from the original when sent to a server.  Yes, per HTTP spec it probably mostly should not.  No, that's not guaranteed even per spec (e.g. behavior for non-list headers that are duplicate is ... well, the RFCs don't really define it very well).  No, not all servers implement HTTP correctly.

-- 
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/481

Received on Friday, 3 February 2017 23:15:20 UTC