RESOLVED FIXED 6275
XMLHttpRequest.getResponseHeader should return a null string for non-existent headers
https://bugs.webkit.org/show_bug.cgi?id=6275
Summary XMLHttpRequest.getResponseHeader should return a null string for non-existent...
Alexey Proskuryakov
Reported 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. <http://whatwg.org/specs/web-apps/current-work/>
Attachments
proposed patch (9.30 KB, patch)
2006-11-25 10:00 PST, Alexey Proskuryakov
ggaren: review+
Alexey Proskuryakov
Comment 1 2006-01-04 02:03:15 PST
Mozilla also documents a null returned value: <http://lxr.mozilla.org/seamonkey/source/extensions/ xmlextras/base/public/nsIXMLHttpRequest.idl#148>
Rob Buis
Comment 2 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... Cheers, Rob.
Alexey Proskuryakov
Comment 3 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.
Anne van Kesteren
Comment 4 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.
Anne van Kesteren
Comment 5 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).
Alexey Proskuryakov
Comment 6 2006-11-25 09:50:12 PST
So, the draft specification was changed, correcting the summary accordingly.
Alexey Proskuryakov
Comment 7 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.
Geoffrey Garen
Comment 8 2006-12-07 15:20:11 PST
Comment on attachment 11628 [details] proposed patch r=me!
Alexey Proskuryakov
Comment 9 2006-12-08 10:37:39 PST
Committed revision 18078.
Note You need to log in before you can comment on or make changes to this bug.