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)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: wisniewskit, Assigned: wisniewskit)

References

Details

(Keywords: dev-doc-complete, site-compat)

Attachments

(1 file)

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
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.
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". "
Attachment #8770984 - Flags: review?(bugs) → review+
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
https://hg.mozilla.org/mozilla-central/rev/54af298e7b99
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: