XHR.getAllResponseHeaders should use CRLF, not LF per spec

RESOLVED FIXED in mozilla17

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
2 years ago

People

(Reporter: Ms2ger, Assigned: capella)

Tracking

(Blocks: 1 bug, {dev-doc-complete})

Trunk
mozilla17
dev-doc-complete
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
We seem to separate headers with just LFs. (Both in nsHeaderVisitor::VisitHeader and nsXMLHttpRequest::GetAllResponseHeaders)
(Assignee)

Comment 1

5 years ago
Created attachment 645225 [details] [diff] [review]
Patch (v1)

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)
(Reporter)

Comment 2

5 years ago
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+
(Assignee)

Comment 3

5 years ago
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
(Assignee)

Comment 4

5 years ago
Nice. With your changes, and this patch, the test page "custom header" error went away:
Pass	XMLHttpRequest: getAllResponseHeaders() excludes cookies
(Assignee)

Comment 5

5 years ago
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+
(Assignee)

Comment 8

5 years ago
Push to TRY:
https://tbpl.mozilla.org/?tree=Try&rev=a4e3236387dc
(Assignee)

Comment 9

5 years ago
On to Inbound:
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=e4330f6365d9
https://hg.mozilla.org/mozilla-central/rev/e4330f6365d9
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17

Updated

5 years ago
Depends on: 778213

Updated

5 years ago
Keywords: dev-doc-needed
Component: DOM: Mozilla Extensions → DOM
Product: Core → Core
XHR doc updated - https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#getAllResponseHeaders%28%29
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.