Closed Bug 730925 Opened 12 years ago Closed 12 years ago

XHR.getAllResponseHeaders should use CRLF, not LF per spec

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: Ms2ger, Assigned: capella)

References

(Blocks 1 open bug, )

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

We seem to separate headers with just LFs. (Both in nsHeaderVisitor::VisitHeader and nsXMLHttpRequest::GetAllResponseHeaders)
Attached patch Patch (v1)Splinter Review
Original TRY version of the patch didn't contain change to mochitest: content/base/test/test_XHR.html
https://tbpl.mozilla.org/?tree=Try&rev=67ce3b709cab

Controlled TRY test of current version with corrected regex:
https://tbpl.mozilla.org/?tree=Try&rev=72c2a8e36a4e
Assignee: nobody → markcapella
Status: NEW → ASSIGNED
Attachment #645225 - Flags: feedback?(Ms2ger)
Comment on attachment 645225 [details] [diff] [review]
Patch (v1)

Review of attachment 645225 [details] [diff] [review]:
-----------------------------------------------------------------

I guess this is fine, but I don't understand the regex at all :)

Can you verify we pass <http://w3c-test.org/webapps/XMLHttpRequest/tests/submissions/Opera/getallresponseheaders-cookies.htm> with this patch?
Attachment #645225 - Flags: feedback?(Ms2ger) → feedback+
Regex is new to me also, I learn just enough to make required patches.

For the linked test, without patch we get:
assert_true: Headers should include a CRLF pair. expected true got false

with the patch it still fails, but now for a different reason / later test:
assert_true: Headers should include the custom header. expected true got false
Nice. With your changes, and this patch, the test page "custom header" error went away:
Pass	XMLHttpRequest: getAllResponseHeaders() excludes cookies
Comment on attachment 645225 [details] [diff] [review]
Patch (v1)

Review request from Module Owner...
Attachment #645225 - Flags: review?(jst)
Comment on attachment 645225 [details] [diff] [review]
Patch (v1)

r=jst assuming Jonas agrees with the spec here. Jonas, any reason not to take this change?
Attachment #645225 - Flags: review?(jst)
Attachment #645225 - Flags: review?(jonas)
Attachment #645225 - Flags: review+
Comment on attachment 645225 [details] [diff] [review]
Patch (v1)

As long as this is the behavior defined by spec
Attachment #645225 - Flags: review?(jonas) → review+
https://hg.mozilla.org/mozilla-central/rev/e4330f6365d9
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Component: DOM: Mozilla Extensions → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: