Closed
Bug 1286744
Opened 8 years ago
Closed 8 years ago
[XHR2] GetAllResponseHeaders() should return an empty string if the XHR failed.
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla50
Tracking | Status | |
---|---|---|
firefox50 | --- | fixed |
People
(Reporter: wisniewskit, Assigned: wisniewskit)
References
Details
(Keywords: dev-doc-complete, site-compat)
Attachments
(1 file)
1.55 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
The XHR spec states that GetAllResponseHeaders() should return the empty string on errors (we're in a "network error" response state, and those are stated to not have any headers). Chrome already passes the relevant web platform test: http://w3c-test.org/XMLHttpRequest/xmlhttprequest-network-error.htm
Assignee | ||
Comment 1•8 years ago
|
||
Here's a patch which passes the test. Try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=dfbd3de4a26d
Attachment #8770984 -
Flags: review?(bugs)
Comment 2•8 years ago
|
||
Comment on attachment 8770984 [details] [diff] [review] 1286744-return_empty_string_for_getAllResponseHeaders_if_errors.diff Where does the spec actually say that. fetch is so unreadable spec that finding anything there is rather hard.
Comment 3•8 years ago
|
||
Ah, this "A network error is a response whose status is always 0, status message is always the empty byte sequence, header list is always empty, body is always null, and cache state is always "none". "
Updated•8 years ago
|
Attachment #8770984 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 4•8 years ago
|
||
Thanks, I'll try to be extra-clear with my wording next time to spare the extra reading exercise. Requesting checkin.
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/54af298e7b99 Return the empty string from GetAllResponseHeaders() if the XHR failed. r=smaug
Keywords: checkin-needed
Comment 6•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/54af298e7b99
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Comment 7•8 years ago
|
||
Posted the site compatibility doc: https://www.fxsitecompat.com/en-CA/docs/2016/network-error-for-async-xhr-now-fires-error-event-instead-of-throwing-getallresponseheaders-will-be-empty/
Keywords: dev-doc-needed,
site-compat
Comment 8•8 years ago
|
||
I have precised the return value of https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders and a mention in https://developer.mozilla.org/en-US/Firefox/Releases/50#DOM_and_HTML_DOM
Updated•8 years ago
|
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•