[webkit-changes] [WebKit/WebKit] d294c9: [ios] Prioritize text/plain MIME type over file ex...
Matthew Finkel
noreply at github.com
Mon Jul 31 11:05:38 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d294c9bf0f3fe2c7bb92dff5efc544c886001681
https://github.com/WebKit/WebKit/commit/d294c9bf0f3fe2c7bb92dff5efc544c886001681
Author: Matthew Finkel <sysrqb at apple.com>
Date: 2023-07-31 (Mon, 31 Jul 2023)
Changed paths:
A LayoutTests/http/tests/mime/resources/.htaccess
A LayoutTests/http/tests/mime/resources/svg-with-html.svg
A LayoutTests/http/tests/mime/resources/xml-with-html.xml
A LayoutTests/http/tests/mime/svg-with-html-expected.txt
A LayoutTests/http/tests/mime/svg-with-html.html
A LayoutTests/http/tests/mime/xml-with-html-expected.txt
A LayoutTests/http/tests/mime/xml-with-html.html
M Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm
Log Message:
-----------
[ios] Prioritize text/plain MIME type over file extension for XML file types
https://bugs.webkit.org/show_bug.cgi?id=257299
rdar://107379119
Reviewed by David Kilzer.
When we receive a file with a text/plain resource, we try harder to find a
better match for the file content, but this can potentially lead to an issue
with some file types like XML. Therefore, if the server says that a file should
be treated as text/plain, and we decide that it is actually XML or SVG, we
prefer using text/plain.
* LayoutTests/http/tests/mime/resources/.htaccess: Added.
* LayoutTests/http/tests/mime/resources/svg-with-html.svg: Added.
* LayoutTests/http/tests/mime/resources/xml-with-html.xml: Added.
* LayoutTests/http/tests/mime/svg-with-html-expected.txt: Added.
* LayoutTests/http/tests/mime/svg-with-html.html: Added.
* LayoutTests/http/tests/mime/xml-with-html-expected.txt: Added.
* LayoutTests/http/tests/mime/xml-with-html.html: Added.
* Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm:
(WebCore::shouldPreferTextPlainMIMEType):
(WebCore::adjustMIMETypeIfNecessary):
Originally-landed-as: 259548.786 at safari-7615-branch (c9d2edfda9b0). rdar://107379119
Canonical link: https://commits.webkit.org/266440@main
More information about the webkit-changes
mailing list