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

Re: setRequestHeader / Accept

From: Maciej Stachowiak <mjs@apple.com>
Date: Mon, 26 May 2008 01:00:26 -0700
Cc: Anne van Kesteren <annevk@opera.com>, Laurens Holst <lholst@students.cs.uu.nl>, public-webapi@w3.org
Message-Id: <23BFD1BC-AC50-4B6A-8B9B-92E1C0FFE0DE@apple.com>
To: Julian Reschke <julian.reschke@gmx.de>

On May 25, 2008, at 11:06 PM, Julian Reschke wrote:

> Maciej Stachowiak wrote:
>> Treating null as empty string here may be sensible (no strong  
>> opinion either way) but removing the header when set to empty seems  
>> wrong. If header removal is really essential we should add a method  
>> for it.
> In HTTP, absence of a header is different from having an empty value.
> I can understand the argument that set(..., null) is the wrong way  
> to remove a value.


> But if it doesn't, it shouldn't do anything that a non-null argument  
> would do.

Why not? In nearly every JS API that takes a string, the JS value null  
is either treated the same as the empty string, or the same as the  
string "null".

> So yes, an explicit way to remove an header would be good. Otherwise  
> we'll see broken requests on the wire (as just seen in the example I  
> cited a few days ago).

I am ok with deferring such a mechanism to XHR2 however. In WebKit  
we'll likely implement it equally quickly whether it is in XHR1 or  
XHR2 since it seems like useful functionality. But there are  
complications, namely, how does it interact with headers that are set  
automatically by the UA?

Received on Monday, 26 May 2008 08:01:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:27 UTC