Bug 6275 - XMLHttpRequest.getResponseHeader should return a null string for non-existent headers
Summary: XMLHttpRequest.getResponseHeader should return a null string for non-existent...
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Minor
Assignee: Alexey Proskuryakov
URL: http://www.hixie.ch/tests/adhoc/dom/w...
Depends on:
Reported: 2005-12-28 13:40 PST by Alexey Proskuryakov
Modified: 2006-12-08 10:37 PST (History)
3 users (show)

See Also:

proposed patch (9.30 KB, patch)
2006-11-25 10:00 PST, Alexey Proskuryakov
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2005-12-28 13:40:36 PST
The current version of the Web Applications spec says so, and presumably this is how WinIE behaves. I 
cannot say that I find such behavior reasonable, though.

Firefox returns null, while Safari returns undefined.

Comment 1 Alexey Proskuryakov 2006-01-04 02:03:15 PST
Mozilla also documents a null returned value: <http://lxr.mozilla.org/seamonkey/source/extensions/
Comment 2 Rob Buis 2006-05-11 13:30:07 PDT
Just a remark, this is easily fixed by using jsString() instead of jsStringOrUndefined(), I verified
this. However ap reported to me that this spec is not settled...

Comment 3 Alexey Proskuryakov 2006-05-11 13:36:57 PDT
The draft spec is now at <http://www.w3.org/TR/XMLHttpRequest/>. I don't know if this specific provision is being disputed, but as long as Firefox doesn't comply, we probably needn't, as well.
Comment 4 Anne van Kesteren 2006-06-18 02:51:11 PDT
Both IE7 and O9 pass that test. I'm not really convinced this should be changed in favor of F1.5 and S2.
Comment 5 Anne van Kesteren 2006-06-18 07:54:26 PDT
So given your comments on IRC I suggest you raise this on public-webapi@w3.org. Including the fact that it's useful sometimes to distinguish between having a header not set at all and having it set to the emtpy string even though that's against the spirit of HTTP (if I understood Maciej correctly).
Comment 6 Alexey Proskuryakov 2006-11-25 09:50:12 PST
So, the draft specification was changed, correcting the summary accordingly.
Comment 7 Alexey Proskuryakov 2006-11-25 10:00:50 PST
Created attachment 11628 [details]
proposed patch

This patch modifies our copy of Hixie's test, which didn't conform to the updated draft spec.
Comment 8 Geoffrey Garen 2006-12-07 15:20:11 PST
Comment on attachment 11628 [details]
proposed patch

Comment 9 Alexey Proskuryakov 2006-12-08 10:37:39 PST
Committed revision 18078.