W3C home > Mailing lists > Public > public-webapi@w3.org > May 2008

Re: [XHR] Overriding Request Headers with setRequestHeader()

From: Anne van Kesteren <annevk@opera.com>
Date: Mon, 12 May 2008 17:21:33 +0200
To: "Lachlan Hunt" <lachlan.hunt@lachy.id.au>, public-webapi <public-webapi@w3.org>
Message-ID: <op.ua1rl7z164w2qv@annevk-t60.oslo.opera.com>

On Wed, 23 Apr 2008 12:42:24 +0200, Lachlan Hunt  
<lachlan.hunt@lachy.id.au> wrote:
> So, what should the UA do for headers that are not defined to be  
> comma-separated?  For example, in the case of setting Content-Type twice  
> to two different values, does the latter override the former?
>
> [...]
> client.setRequestHeader("Content-Type", "text/plain");
> client.setRequestHeader("Content-Type", "text/html");
> client.send(data);

In that case you would get

   Content-Type:text/plain, text/html

or something. As defined the setRequestHeader() API is not aware of the  
semantics of the headers and header values that are passed through. (This  
differs a lot accross implementations too. I guess authors only use  
"setRequestHeader('x-foo','bar')" and nothing more complex.)


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Monday, 12 May 2008 15:22:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 12 May 2008 15:22:35 GMT