[Fetch API] Headers should be combine with ',' and not ', '
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Sep 2016 08:24:18 +0000 (08:24 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Sep 2016 08:24:18 +0000 (08:24 +0000)
commit4c1322206e4a49f803b32460567704fadc2712f4
tree31e3384dcb79fccbc5c1cb21dde87409006b3681
parentf68c3ae0294633d8b7616ba7e61f1c5a039688cc
[Fetch API] Headers should be combine with ',' and not ', '
https://bugs.webkit.org/show_bug.cgi?id=161736

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-16
Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/XMLHttpRequest/setrequestheader-case-insensitive.htm: Making ',' combination as expected.
* web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed-expected.txt: Some new header tests are failing.
This is due to the fact that the underlying HTTP code is probably reprocessing those headers and readding ', ' in lieu of ','.
* web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed.htm: Ditto.
* web-platform-tests/fetch/api/cors/cors-preflight.js:
(corsPreflight): Removing stripping of whitespaces
* web-platform-tests/fetch/api/headers/headers-combine.html: Making ',' combination as expected.

Source/WebCore:

Covered by updated tests and http/tests/xmlhttprequest/check-combining-headers.html.

* loader/CrossOriginAccessControl.cpp:
(WebCore::createAccessControlPreflightRequest): Combining with ',' for Access-Control-Request-Headers
* platform/network/HTTPHeaderMap.cpp:
(HTTPHeaderMap::add): Combining with ','

LayoutTests:

* http/tests/xmlhttprequest/check-combining-headers-expected.txt:
* http/tests/xmlhttprequest/check-combining-headers.html: Checking combined headers.
* http/tests/xmlhttprequest/resources/print-headers.php: Printing all request headers in a JSON response.
* http/tests/xmlhttprequest/web-apps/005.html: Making ',' combination as expected.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/xmlhttprequest/check-combining-headers-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/check-combining-headers.html [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/resources/print-headers.php [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/web-apps/005.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-case-insensitive.htm
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed-expected.txt
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed.htm
LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.js
LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-combine-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/loader/CrossOriginAccessControl.cpp
Source/WebCore/platform/network/HTTPHeaderMap.cpp