W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2007

[whatwg] XMLHttpRequest: getAllResponseHeaders

From: Anne van Kesteren <annevk@opera.com>
Date: Mon, 05 Mar 2007 23:15:36 +0100
Message-ID: <op.toqlgalv64w2qv@id-c0020.driveway.uu.nl>
Hi,

Hixie forwarded your comments to me as I'm now the editor of the  
XMLHttpRequest specification:

   http://www.w3.org/TR/XMLHttpRequest/


On Wed, 22 Jun 2005 10:44:39 +0200, Hallvord Reiar Michaelsen Steen  
<hallvord at hallvord.com> wrote:
>> > getAllResponseHeaders()
>> > If the readyState attribute has a value other than 3 (Receiving) or
>> > 4 (Loaded), returns null.
>
>> 1) This seems a bit inconsistent since the spec says that accessing
>> status and statusText out of order should cause exception.
>> 2) This is not what UAs actually do. IE and FF throw an exception and
>> Opera returns an empty string.
>
> Same applies to getResponseHeader, except that the spec actually says
> "return empty string" rather than null here.
>
> FF actually throws an exception if you try to read a non-existing
> header. The spec recommendation is returning an empty string, which
> seems better.

This should also be clarified / fixed.

Cheers,


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Monday, 5 March 2007 14:15:36 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:53 UTC