Changeset 206014 in webkit
- Timestamp:
- Sep 16, 2016 1:24:18 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r206011 r206014 1 2016-09-16 Youenn Fablet <youenn@apple.com> 2 3 [Fetch API] Headers should be combine with ',' and not ', ' 4 https://bugs.webkit.org/show_bug.cgi?id=161736 5 6 Reviewed by Sam Weinig. 7 8 * http/tests/xmlhttprequest/check-combining-headers-expected.txt: 9 * http/tests/xmlhttprequest/check-combining-headers.html: Checking combined headers. 10 * http/tests/xmlhttprequest/resources/print-headers.php: Printing all request headers in a JSON response. 11 * http/tests/xmlhttprequest/web-apps/005.html: Making ',' combination as expected. 12 1 13 2016-09-16 Youenn Fablet <youenn@apple.com> 2 14 -
trunk/LayoutTests/http/tests/xmlhttprequest/check-combining-headers.html
r206011 r206014 2 2 <html> 3 3 <head> 4 <title>XMLHttpRequest: setRequestHeader() - headers that are allowed</title>4 <title>XMLHttpRequest: setRequestHeader() - combining headers </title> 5 5 <script src="/resources/testharness.js"></script> 6 6 <script src="/resources/testharnessreport.js"></script> 7 <link rel="help" href="https://xhr.spec.whatwg.org/#the-setrequestheader()-method" data-tested-assertations="/following::ol/li[6] /following::ol/li[7]" /> 7 <link rel="help" href="https://xhr.spec.whatwg.org/#the-setrequestheader()-method" data-tested-assertations="/following::ol/li[6] /following::ol/li[7]" /> 8 8 </head> 9 9 <body> 10 10 <div id="log"></div> 11 11 <script> 12 function request(header ) {12 function request(header, doNotshowFullValueInError) { 13 13 test(function() { 14 14 var client = new XMLHttpRequest() 15 client.open("POST", "resources/ inspect-headers.py?filter_value=t1, t2", false)15 client.open("POST", "resources/print-headers.php", false) 16 16 client.setRequestHeader(header, "t1") 17 17 client.setRequestHeader(header, "t2") 18 18 client.send(null) 19 assert_equals(client.responseText, header.toLowerCase() + ",") 19 if (!doNotshowFullValueInError) 20 assert_equals(JSON.parse(client.response)[header.toLowerCase()], "t1,t2", "Combined header value should be t1,t2") 21 else 22 assert_true(JSON.parse(client.response)[header.toLowerCase()] == "t1,t2", "Combined header value should be t1,t2") 20 23 }, document.title + " (" + header + ")") 21 24 } 22 25 request("Authorization") 23 26 request("Pragma") 24 request("User-Agent" )27 request("User-Agent", true) 25 28 request("Content-Transfer-Encoding") 26 29 request("Content-Type") -
trunk/LayoutTests/http/tests/xmlhttprequest/web-apps/005.html
r120167 r206014 20 20 r.setRequestHeader('X-Test-Header', 'TWO'); 21 21 r.send(null); 22 if (r.responseText == 'RESULT:[ONE, 22 if (r.responseText == 'RESULT:[ONE,TWO]') { 23 23 p.firstChild.data = 'PASS'; 24 24 } else { -
trunk/LayoutTests/imported/w3c/ChangeLog
r206009 r206014 1 2016-09-16 Youenn Fablet <youenn@apple.com> 2 3 [Fetch API] Headers should be combine with ',' and not ', ' 4 https://bugs.webkit.org/show_bug.cgi?id=161736 5 6 Reviewed by Sam Weinig. 7 8 * web-platform-tests/XMLHttpRequest/setrequestheader-case-insensitive.htm: Making ',' combination as expected. 9 * web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed-expected.txt: Some new header tests are failing. 10 This is due to the fact that the underlying HTTP code is probably reprocessing those headers and readding ', ' in lieu of ','. 11 * web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed.htm: Ditto. 12 * web-platform-tests/fetch/api/cors/cors-preflight.js: 13 (corsPreflight): Removing stripping of whitespaces 14 * web-platform-tests/fetch/api/headers/headers-combine.html: Making ',' combination as expected. 15 1 16 2016-09-16 Youenn Fablet <youenn@apple.com> 2 17 -
trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-case-insensitive.htm
r191546 r206014 12 12 test(function() { 13 13 var client = new XMLHttpRequest() 14 client.open("POST", "resources/inspect-headers.py?filter_value=t1, t2,t3", false)14 client.open("POST", "resources/inspect-headers.py?filter_value=t1,t2,t3", false) 15 15 client.setRequestHeader("x-test", "t1") 16 16 client.setRequestHeader("X-TEST", "t2") -
trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed-expected.txt
r191546 r206014 4 4 CONSOLE MESSAGE: line 17: Refused to set unsafe header "Content-Transfer-Encoding" 5 5 6 PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (Authorization) 7 PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (Pragma) 6 FAIL XMLHttpRequest: setRequestHeader() - headers that are allowed (Authorization) assert_equals: expected "authorization," but got "" 7 FAIL XMLHttpRequest: setRequestHeader() - headers that are allowed (Pragma) assert_equals: expected "pragma," but got "" 8 8 FAIL XMLHttpRequest: setRequestHeader() - headers that are allowed (User-Agent) assert_equals: expected "user-agent," but got "" 9 9 FAIL XMLHttpRequest: setRequestHeader() - headers that are allowed (Content-Transfer-Encoding) assert_equals: expected "content-transfer-encoding," but got "" 10 PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (Content-Type) 10 FAIL XMLHttpRequest: setRequestHeader() - headers that are allowed (Content-Type) assert_equals: expected "content-type," but got "" 11 11 PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (Overwrite) 12 12 PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (If) -
trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed.htm
r191546 r206014 13 13 test(function() { 14 14 var client = new XMLHttpRequest() 15 client.open("POST", "resources/inspect-headers.py?filter_value=t1, 15 client.open("POST", "resources/inspect-headers.py?filter_value=t1,t2", false) 16 16 client.setRequestHeader(header, "t1") 17 17 client.setRequestHeader(header, "t2") -
trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.js
r205743 r206014 53 53 54 54 let accessControlAllowHeaders = headerNames(headers).sort().join(","); 55 assert_equals(resp.headers.get("x-control-request-headers") .replace(new RegExp(" ", "g"), ""), accessControlAllowHeaders, "Access-Control-Allow-Headers value");55 assert_equals(resp.headers.get("x-control-request-headers"), accessControlAllowHeaders, "Access-Control-Allow-Headers value"); 56 56 return fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token); 57 57 } -
trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-combine-expected.txt
r205743 r206014 1 1 2 FAIL Create headers using same name for different values assert_equals: name: double has value: doubleValue1,doubleValue2 expected "doubleValue1,doubleValue2" but got "doubleValue1, doubleValue2" 2 PASS Create headers using same name for different values 3 3 PASS Check delete and has methods when using same name for different values 4 4 PASS Check set methods when called with already used name 5 FAIL Check append methods when called with already used name assert_equals: name: single has value: singleValue, newSingleValue expected "singleValue,newSingleValue" but got "singleValue, newSingleValue" 5 PASS Check append methods when called with already used name 6 6 -
trunk/Source/WebCore/ChangeLog
r206011 r206014 1 2016-09-16 Youenn Fablet <youenn@apple.com> 2 3 [Fetch API] Headers should be combine with ',' and not ', ' 4 https://bugs.webkit.org/show_bug.cgi?id=161736 5 6 Reviewed by Sam Weinig. 7 8 Covered by updated tests and http/tests/xmlhttprequest/check-combining-headers.html. 9 10 * loader/CrossOriginAccessControl.cpp: 11 (WebCore::createAccessControlPreflightRequest): Combining with ',' for Access-Control-Request-Headers 12 * platform/network/HTTPHeaderMap.cpp: 13 (HTTPHeaderMap::add): Combining with ',' 14 1 15 2016-09-16 Youenn Fablet <youenn@apple.com> 2 16 -
trunk/Source/WebCore/loader/CrossOriginAccessControl.cpp
r206009 r206014 129 129 bool appendComma = false; 130 130 for (const auto& headerField : unsafeHeaders) { 131 // FIXME: header names should be separated by 0x2C, without space.132 131 if (appendComma) 133 headerBuffer.append Literal(", ");132 headerBuffer.append(','); 134 133 else 135 134 appendComma = true; -
trunk/Source/WebCore/platform/network/HTTPHeaderMap.cpp
r202126 r206014 98 98 auto result = m_uncommonHeaders.add(name, value); 99 99 if (!result.isNewEntry) 100 result.iterator->value = result.iterator->value + ", " + value;100 result.iterator->value = makeString(result.iterator->value, ",", value); 101 101 return; 102 102 }
Note: See TracChangeset
for help on using the changeset viewer.