Last Comment Bug 730925 - XHR.getAllResponseHeaders should use CRLF, not LF per spec
: XHR.getAllResponseHeaders should use CRLF, not LF per spec
Status: RESOLVED FIXED
: dev-doc-complete
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla17
Assigned To: Mark Capella [:capella]
:
Mentors:
http://dvcs.w3.org/hg/xhr/raw-file/ti...
Depends on: 778213
Blocks: 726433
  Show dependency treegraph
 
Reported: 2012-02-27 12:12 PST by :Ms2ger
Modified: 2015-10-18 10:58 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (v1) (2.97 KB, patch)
2012-07-24 01:28 PDT, Mark Capella [:capella]
jst: review+
jonas: review+
Ms2ger: feedback+
Details | Diff | Review

Description :Ms2ger 2012-02-27 12:12:10 PST
We seem to separate headers with just LFs. (Both in nsHeaderVisitor::VisitHeader and nsXMLHttpRequest::GetAllResponseHeaders)
Comment 1 Mark Capella [:capella] 2012-07-24 01:28:50 PDT
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
Comment 2 :Ms2ger 2012-07-24 03:07:48 PDT
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?
Comment 3 Mark Capella [:capella] 2012-07-24 04:06:31 PDT
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
Comment 4 Mark Capella [:capella] 2012-07-24 07:55:13 PDT
Nice. With your changes, and this patch, the test page "custom header" error went away:
Pass	XMLHttpRequest: getAllResponseHeaders() excludes cookies
Comment 5 Mark Capella [:capella] 2012-07-24 08:07:02 PDT
Comment on attachment 645225 [details] [diff] [review]
Patch (v1)

Review request from Module Owner...
Comment 6 Johnny Stenback (:jst, jst@mozilla.com) 2012-07-24 10:01:02 PDT
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?
Comment 7 Jonas Sicking (:sicking) 2012-07-25 14:01:52 PDT
Comment on attachment 645225 [details] [diff] [review]
Patch (v1)

As long as this is the behavior defined by spec
Comment 8 Mark Capella [:capella] 2012-07-26 08:54:22 PDT
Push to TRY:
https://tbpl.mozilla.org/?tree=Try&rev=a4e3236387dc
Comment 9 Mark Capella [:capella] 2012-07-26 13:32:03 PDT
On to Inbound:
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=e4330f6365d9
Comment 10 Matt Brubeck (:mbrubeck) 2012-07-26 14:07:21 PDT
https://hg.mozilla.org/mozilla-central/rev/e4330f6365d9
Comment 11 Saurabh Nair [:jsx] (not reading all bugmail. ni? if you need me) 2015-10-18 10:58:43 PDT
XHR doc updated - https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#getAllResponseHeaders%28%29

Note You need to log in before you can comment on or make changes to this bug.