Re: [whatwg/xhr] setRequestHeader behavior doesn't seem to match implementations (#108)

It all depends on how the headers are set.

If the header is set all at once to some string with commas and no spaces in it, then that's the string that will get sent.  That's the Accept-Encoding situation: it's set all at once.

But if the header is set multiple times with the same header name and multiple values and the coalescing into a single comma-separated list happens inside the networking library, then the spaces will be there.

Just like if you do (in the current spec):

    xhr.setRequestHeader("foo", "a,    b,     c");

you get a different value sent than if you do:

    xhr.setRequestHeader("foo", "a");
    xhr.setRequestHeader("foo", "b");
    xhr.setRequestHeader("foo", "c");


-- 
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/xhr/issues/108#issuecomment-275396829

Received on Thursday, 26 January 2017 14:11:38 UTC