Changeset 235360 in webkit
- Timestamp:
- Aug 27, 2018 6:40:44 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r235354 r235360 1 2018-08-27 Rob Buis <rbuis@igalia.com> 2 3 XMLHTTPRequest.send for Document should have same Content-Type processing rules as String 4 https://bugs.webkit.org/show_bug.cgi?id=188953 5 6 Reviewed by Darin Adler. 7 8 * platform/gtk/imported/w3c/web-platform-tests/xhr/setrequestheader-content-type-expected.txt: 9 * platform/ios/imported/w3c/web-platform-tests/xhr/setrequestheader-content-type-expected.txt: 10 * platform/wpe/imported/w3c/web-platform-tests/xhr/setrequestheader-content-type-expected.txt: 11 1 12 2018-08-27 Youenn Fablet <youenn@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/ChangeLog
r235358 r235360 1 2018-08-27 Rob Buis <rbuis@igalia.com> 2 3 XMLHTTPRequest.send for Document should have same Content-Type processing rules as String 4 https://bugs.webkit.org/show_bug.cgi?id=188953 5 6 Reviewed by Darin Adler. 7 8 * web-platform-tests/xhr/setrequestheader-content-type-expected.txt: 9 1 10 2018-08-27 Ali Juma <ajuma@chromium.org> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/xhr/setrequestheader-content-type-expected.txt
r235354 r235360 11 11 FAIL XML Document request respects setRequestHeader("") assert_equals: expected "Content-Type: \n" but got "Content-Type: \n" 12 12 PASS XML Document request has correct default Content-Type of "application/xml;charset=UTF-8" 13 FAIL XML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 assert_equals: expected "Content-Type: application/xhtml+xml;charset=UTF-8\n" but got "Content-Type: application/xhtml+xml;charset=ASCII\n" 13 PASS XML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 14 14 FAIL HTML Document request respects setRequestHeader("") assert_equals: expected "Content-Type: \n" but got "Content-Type: \n" 15 15 PASS HTML Document request has correct default Content-Type of "text/html;charset=UTF-8" 16 FAIL HTML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 assert_equals: expected "Content-Type: text/html+junk;charset=UTF-8\n" but got "Content-Type: text/html+junk;charset=ASCII\n" 16 PASS HTML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 17 17 FAIL Blob request respects setRequestHeader("") to be specified assert_equals: expected "Content-Type: \n" but got "Content-Type: \n" 18 18 FAIL Blob request with unset type sends no Content-Type without setRequestHeader() call assert_equals: expected "" but got "Content-Type: \n" -
trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/xhr/setrequestheader-content-type-expected.txt
r235354 r235360 11 11 FAIL XML Document request respects setRequestHeader("") assert_equals: expected "Content-Type: \n" but got "Content-Type: \n" 12 12 PASS XML Document request has correct default Content-Type of "application/xml;charset=UTF-8" 13 FAIL XML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 assert_equals: expected "Content-Type: application/xhtml+xml;charset=UTF-8\n" but got "Content-Type: application/xhtml+xml;charset=ASCII\n" 13 PASS XML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 14 14 FAIL HTML Document request respects setRequestHeader("") assert_equals: expected "Content-Type: \n" but got "Content-Type: \n" 15 15 PASS HTML Document request has correct default Content-Type of "text/html;charset=UTF-8" 16 FAIL HTML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 assert_equals: expected "Content-Type: text/html+junk;charset=UTF-8\n" but got "Content-Type: text/html+junk;charset=ASCII\n" 16 PASS HTML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 17 17 FAIL Blob request respects setRequestHeader("") to be specified assert_equals: expected "Content-Type: \n" but got "Content-Type: \n" 18 18 FAIL Blob request with unset type sends no Content-Type without setRequestHeader() call assert_equals: expected "" but got "Content-Type: \n" -
trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/xhr/setrequestheader-content-type-expected.txt
r235354 r235360 11 11 PASS XML Document request respects setRequestHeader("") 12 12 PASS XML Document request has correct default Content-Type of "application/xml;charset=UTF-8" 13 FAIL XML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 assert_equals: expected "content-type: application/xhtml+xml;charset=utf-8" but got "content-type: application/xhtml+xml;charset=ascii" 13 PASS XML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 14 14 PASS HTML Document request respects setRequestHeader("") 15 15 PASS HTML Document request has correct default Content-Type of "text/html;charset=UTF-8" 16 FAIL HTML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 assert_equals: expected "content-type: text/html+junk;charset=utf-8" but got "content-type: text/html+junk;charset=ascii" 16 PASS HTML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 17 17 PASS Blob request respects setRequestHeader("") to be specified 18 18 FAIL Blob request with unset type sends no Content-Type without setRequestHeader() call assert_equals: expected "" but got "content-type: " -
trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/xhr/setrequestheader-content-type-expected.txt
r235354 r235360 11 11 FAIL XML Document request respects setRequestHeader("") assert_equals: expected "Content-Type: \n" but got "Content-Type: \n" 12 12 PASS XML Document request has correct default Content-Type of "application/xml;charset=UTF-8" 13 FAIL XML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 assert_equals: expected "Content-Type: application/xhtml+xml;charset=UTF-8\n" but got "Content-Type: application/xhtml+xml;charset=ASCII\n" 13 PASS XML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 14 14 FAIL HTML Document request respects setRequestHeader("") assert_equals: expected "Content-Type: \n" but got "Content-Type: \n" 15 15 PASS HTML Document request has correct default Content-Type of "text/html;charset=UTF-8" 16 FAIL HTML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 assert_equals: expected "Content-Type: text/html+junk;charset=UTF-8\n" but got "Content-Type: text/html+junk;charset=ASCII\n" 16 PASS HTML Document request keeps setRequestHeader() Content-Type, with charset adjusted to UTF-8 17 17 FAIL Blob request respects setRequestHeader("") to be specified assert_equals: expected "Content-Type: \n" but got "Content-Type: \n" 18 18 FAIL Blob request with unset type sends no Content-Type without setRequestHeader() call assert_equals: expected "" but got "Content-Type: \n" -
trunk/Source/WebCore/ChangeLog
r235358 r235360 1 2018-08-27 Rob Buis <rbuis@igalia.com> 2 3 XMLHTTPRequest.send for Document should have same Content-Type processing rules as String 4 https://bugs.webkit.org/show_bug.cgi?id=188953 5 6 Reviewed by Darin Adler. 7 8 Processing rules for Content-Type have been implemented for send with String as parameter, but 9 not for Document, but both should be treated the same according to the spec [1]. This patch 10 implements this. 11 12 Behavior matches Firefox. 13 14 [1] https://xhr.spec.whatwg.org/#the-send()-method 15 16 Test: web-platform-tests/XMLHttpRequest/setrequestheader-content-type.htm 17 18 * xml/XMLHttpRequest.cpp: 19 (WebCore::XMLHttpRequest::send): 20 1 21 2018-08-27 Ali Juma <ajuma@chromium.org> 2 22 -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r235355 r235360 462 462 // FIXME: this should include the charset used for encoding. 463 463 m_requestHeaders.set(HTTPHeaderName::ContentType, document.isHTMLDocument() ? "text/html;charset=UTF-8"_s : "application/xml;charset=UTF-8"_s); 464 } else { 465 String contentType = m_requestHeaders.get(HTTPHeaderName::ContentType); 466 replaceCharsetInMediaType(contentType, "UTF-8"); 467 m_requestHeaders.set(HTTPHeaderName::ContentType, contentType); 464 468 } 465 469
Note: See TracChangeset
for help on using the changeset viewer.