Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch: header names are exposed in lowercase and values separated by 0x2C 0x20 #5115

Merged
merged 1 commit into from Mar 10, 2017

Conversation

annevk
Copy link
Member

@annevk annevk commented Mar 10, 2017

@wpt-pr-bot
Copy link
Collaborator

@w3c-bots
Copy link

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision e22f41848f05f6dabffeb726f5fbc58b9882976f
Using browser at version BuildID 20170306110339; SourceStamp 966464a68a2cb3ca1125808e34abb5c1d34e3797
Starting 10 test iterations
All results were stable

All results

2 tests ran
/XMLHttpRequest/getallresponseheaders-cl.htm
Subtest Results Messages
OK
Casing of known headers FAIL assert_equals: expected "content-length: 0\r\n" but got "Content-Length: 0\r\n"
Casing of known headers 1 FAIL assert_regexp_match: expected object "/content-TYPE/" but got "Host: web-platform.test:8000\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0\r\nAccept: */*\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nReferer: http://web-platform.test:8000/XMLHttpRequest/getallresponseheaders-cl.htm\r\nTHIS-IS-A-TEST: 1, 2\r\nContent-Type: x/x\r\nConnection: keep-alive\r\n"
Casing of known headers 2 FAIL assert_regexp_match: expected object "/THIS-is-A-test: 1, 2/" but got "Host: web-platform.test:8000\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0\r\nAccept: */*\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nReferer: http://web-platform.test:8000/XMLHttpRequest/getallresponseheaders-cl.htm\r\nTHIS-IS-A-TEST: 2\r\norigin: http://web-platform.test:8000\r\nConnection: keep-alive\r\n"
/fetch/api/headers/headers-combine.html
Subtest Results Messages
OK
Create headers using same name for different values FAIL assert_equals: expected "doubleValue1, doubleValue2" but got "doubleValue1,doubleValue2"
Check delete and has methods when using same name for different values PASS
Check set methods when called with already used name PASS
Check append methods when called with already used name FAIL assert_equals: expected "singleValue, newSingleValue" but got "singleValue,newSingleValue"

@w3c-bots
Copy link

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision e22f41848f05f6dabffeb726f5fbc58b9882976f
Using browser at version 58.0.3029.6 dev
Starting 10 test iterations
All results were stable

All results

2 tests ran
/XMLHttpRequest/getallresponseheaders-cl.htm
Subtest Results Messages
OK
Casing of known headers FAIL assert_equals: expected "content-length: 0\r\n" but got "CONTENT-LENGTH: 0\r\n"
Casing of known headers 1 PASS
Casing of known headers 2 FAIL assert_regexp_match: expected object "/THIS-is-A-test: 1, 2/" but got "Host: web-platform.test:8000\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.6 Safari/537.36\r\nthis-is-a-test: 1,2\r\nAccept: */*\r\nReferer: http://web-platform.test:8000/XMLHttpRequest/getallresponseheaders-cl.htm\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-US,en;q=0.8\r\n"
/fetch/api/headers/headers-combine.html
Subtest Results Messages
OK
Create headers using same name for different values FAIL assert_equals: expected "doubleValue1, doubleValue2" but got "doubleValue1,doubleValue2"
Check delete and has methods when using same name for different values PASS
Check set methods when called with already used name PASS
Check append methods when called with already used name FAIL assert_equals: expected "singleValue, newSingleValue" but got "singleValue,newSingleValue"

@annevk annevk merged commit c7b0af2 into master Mar 10, 2017
annevk added a commit to whatwg/fetch that referenced this pull request Mar 10, 2017
Instead of just 0x2C, use 0x2C 0x20 somewhat consistently (except where we can't and point it out) as that is what XMLHttpRequest implementations have always done and nobody likes too much change.

Tests: web-platform-tests/wpt#5115.

Fixes the Fetch part of whatwg/xhr#108 and whatwg/xhr#109.
@annevk annevk deleted the annevk/fetch-headers branch March 10, 2017 18:10
annevk added a commit to whatwg/xhr that referenced this pull request Mar 13, 2017
In particular, setRequestHeader() should use 0x2C 0x20 as separator (not just 0x2C) and get(All)ResponseHeader(s)() should do so too. The latter also always needs to end in 0x0D 0x0A rather than omitting it at the end.

This depends on whatwg/fetch#504 landing first.

Tests: web-platform-tests/wpt#4641, web-platform-tests/wpt#5008, and web-platform-tests/wpt#5115.

Fixes #108 and fixes #109.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants