WebKit Bugzilla
Attachment 349299 Details for
Bug 189465
: XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189465-20180910094738.patch (text/plain), 7.07 KB, created by
Rob Buis
on 2018-09-10 00:47:39 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2018-09-10 00:47:39 PDT
Size:
7.07 KB
patch
obsolete
>Subversion Revision: 235836 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8375217f8686e250bb3a23429f0200fb573ffe7e..85cb4940a7e64390388773f945699212fa553a37 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2018-09-09 Rob Buis <rbuis@igalia.com> >+ >+ XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header >+ https://bugs.webkit.org/show_bug.cgi?id=189465 >+ >+ Reviewed by Frédéric Wang. >+ >+ The xhr spec changed [1, 2] so that overrideMimeType should not update the >+ response's "Content-Type" header anymore. >+ >+ Behavior matches Firefox and Chrome. >+ >+ [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-overridemimetype >+ [2] https://github.com/whatwg/xhr/issues/157 >+ >+ Tests: http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html >+ web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm >+ >+ * xml/XMLHttpRequest.cpp: >+ (WebCore::XMLHttpRequest::didReceiveResponse): >+ > 2018-09-08 Andy Estes <aestes@apple.com> > > [Apple Pay] Dispatch a paymentmethodchange event when the payment method changes >diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp >index a9ab362ef69929898a8e2f7e851494f3bde39636..8d8f83d04c55ad6b7286ef78bbf8b6449ad577e8 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.cpp >+++ b/Source/WebCore/xml/XMLHttpRequest.cpp >@@ -965,8 +965,6 @@ void XMLHttpRequest::didSendData(unsigned long long bytesSent, unsigned long lon > void XMLHttpRequest::didReceiveResponse(unsigned long, const ResourceResponse& response) > { > m_response = response; >- if (!m_mimeTypeOverride.isEmpty()) >- m_response.setHTTPHeaderField(HTTPHeaderName::ContentType, m_mimeTypeOverride); > } > > static inline bool shouldDecodeResponse(XMLHttpRequest::ResponseType type) >@@ -1026,7 +1024,6 @@ void XMLHttpRequest::didReceiveData(const char* data, int len) > if (readyState() < HEADERS_RECEIVED) > changeState(HEADERS_RECEIVED); > >- // FIXME: Should we update "Content-Type" header field with m_mimeTypeOverride value in case it has changed since didReceiveResponse? > if (!m_mimeTypeOverride.isEmpty()) > m_responseEncoding = extractCharsetFromMediaType(m_mimeTypeOverride); > if (m_responseEncoding.isEmpty()) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 12471961363d0e97374dca30507edb4c9bd0d273..f78e472c81dc022b50a5c130fe04f00fd1c7a803 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-09-09 Rob Buis <rbuis@igalia.com> >+ >+ XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header >+ https://bugs.webkit.org/show_bug.cgi?id=189465 >+ >+ Reviewed by Frédéric Wang. >+ >+ Change existing test to reflect new behavior. >+ >+ * http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt: >+ * http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html: >+ > 2018-09-08 Wenson Hsieh <wenson_hsieh@apple.com> > > REGRESSION (r235153): [iOS] Can't move selection start grabber when selecting text in a subframe >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index c0bc2d610ae0277a6141ba94ec165161ccf7f54c..1f81e78456f1e7ce417d161f2bcc9129817486fb 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,12 @@ >+2018-09-09 Rob Buis <rbuis@igalia.com> >+ >+ XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header >+ https://bugs.webkit.org/show_bug.cgi?id=189465 >+ >+ Reviewed by Frédéric Wang. >+ >+ * web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt: >+ > 2018-09-07 Youenn Fablet <youenn@apple.com> > > Add support for unified plan transceivers >diff --git a/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt >index 0fbe1e884322604095bbc80bdcecad679a4bce8c..880b205f89c2b0ae920340dc50907621a7070667 100644 >--- a/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt >+++ b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt >@@ -1,9 +1,9 @@ >-This tests that XMLHttpRequest overrideMimeType() properly updates the Content-Type header for the response. >+This tests that XMLHttpRequest overrideMimeType() does not update the Content-Type header for the response. > > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > > >-PASS xhr.getResponseHeader("Content-Type") is "text/xml;charset=GBK" >+PASS xhr.getResponseHeader("Content-Type") is "application/xml" > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html >index 9c2b96883cfbc2699d1156405855b6789b74bfe9..04add7a5d82b707707cf871b26dd2112ba18d0ee 100644 >--- a/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html >+++ b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html >@@ -5,7 +5,7 @@ > </head> > <body> > <script> >- description('This tests that XMLHttpRequest overrideMimeType() properly updates the Content-Type header for the response.'); >+ description('This tests that XMLHttpRequest overrideMimeType() does not update the Content-Type header for the response.'); > window.jsTestIsAsync = true; > > var xhr = new XMLHttpRequest(); >@@ -13,7 +13,7 @@ > > xhr.onreadystatechange = function () { > if (xhr.readyState == xhr.LOADING) { >- shouldBe('xhr.getResponseHeader("Content-Type")', '"text/xml;charset=GBK"'); >+ shouldBe('xhr.getResponseHeader("Content-Type")', '"application/xml"'); > finishJSTest(); > } > } >diff --git a/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt >index b043d7e2e7872fed579f5c108c170712737f5d9d..5758656fb3d96991e3f4a449b003f19cba15099f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt >@@ -1,5 +1,5 @@ > >-FAIL Bogus MIME type does not override encoding assert_equals: expected "text/html;charset=windows-1252" but got "bogus" >+PASS Bogus MIME type does not override encoding > FAIL Bogus MIME type does not override encoding, 2 assert_equals: expected "ÿ" but got "\x1a" >-FAIL Bogus MIME type does override MIME type assert_equals: expected "text/xml" but got "bogus" >+PASS Bogus MIME type does override MIME type >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189465
:
349289
|
349291
|
349296
| 349299