XMLHttpRequest removes spaces from content-types before processing
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2018 20:31:18 +0000 (20:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2018 20:31:18 +0000 (20:31 +0000)
commitc9ae25a91b8d5ff1da7f87d7f77ee1da4132ac9f
treef9473e9d121af781227594a4c2de046dbd133611
parent4264ecb2c5be1819938b3cd6d5c49b1400347d69
XMLHttpRequest removes spaces from content-types before processing
https://bugs.webkit.org/show_bug.cgi?id=8644

Patch by Rob Buis <rbuis@igalia.com> on 2018-12-10
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Update improved test expectations.

* web-platform-tests/mimesniff/mime-types/parsing.any-expected.txt:
* web-platform-tests/mimesniff/mime-types/parsing.any.worker-expected.txt:

Source/WebCore:

Stop trimming white space characters from the middle of
type/subtype value. Also make sure whitespace being parsed
adheres to OWS definition from RFC 7230 Section 3.2.3
(referenced by RFC 7231), i.e. space or HT.

Based on http://crrev.com/416586.

Behavior matches Firefox and Chrome.

Tests: http/tests/xmlhttprequest/supported-xml-content-types.html
       web-platform-tests/mimesniff/mime-types/parsing.any.html
       web-platform-tests/mimesniff/mime-types/parsing.any.worker.html

* platform/network/HTTPParsers.cpp:
(WebCore::extractMIMETypeFromMediaType):

LayoutTests:

Update improved test expectation and remove comment.

* http/tests/xmlhttprequest/supported-xml-content-types-expected.txt:
* http/tests/xmlhttprequest/supported-xml-content-types.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239040 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/xmlhttprequest/supported-xml-content-types-expected.txt
LayoutTests/http/tests/xmlhttprequest/supported-xml-content-types.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/mimesniff/mime-types/parsing.any-expected.txt
LayoutTests/imported/w3c/web-platform-tests/mimesniff/mime-types/parsing.any.worker-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/network/HTTPParsers.cpp