Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look at overrideMimeType() again #157

Closed
annevk opened this issue Oct 3, 2017 · 3 comments
Closed

Look at overrideMimeType() again #157

annevk opened this issue Oct 3, 2017 · 3 comments

Comments

@annevk
Copy link
Member

annevk commented Oct 3, 2017

There's a test that checks that text/xml;charset=† is rejected and Chrome has implemented this, but I don't think any other part of the platform reuses that check. What we end up doing is ignoring non-ASCII bytes in MIME types. So we should rewrite XMLHttpRequest/overridemimetype-blob.html and maybe change the requirements in the specification.

This ties into the ever growing whatwg/mimesniff#30.

See https://bugzilla.mozilla.org/show_bug.cgi?id=918731 for more background.

@annevk
Copy link
Member Author

annevk commented Nov 27, 2017

The tentative plan here is that overrideMimeType() invokes the MIME type parser and stores the MIME type record result (rather than the bit without parameters). That means this will build on top of whatwg/mimesniff#36.

@domenic
Copy link
Member

domenic commented Feb 4, 2018

Note that I think right now this does not properly translate charset from an encoding label to an encoding name, although I haven't properly traced through how override charset is used to figure out if maybe using a label is OK.

@annevk
Copy link
Member Author

annevk commented Feb 5, 2018

Hmm yeah, it'd be good to test that as part of #174. In particular if unrecognized labels get skipped somehow. I'll be away for two weeks so probably won't get around to it until I'm back.

annevk added a commit to web-platform-tests/wpt that referenced this issue Apr 10, 2018
annevk added a commit to web-platform-tests/wpt that referenced this issue Apr 10, 2018
annevk added a commit to web-platform-tests/wpt that referenced this issue Apr 17, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@annevk annevk closed this as completed in 121cee5 Apr 17, 2018
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Apr 26, 2018
…) tests, a=testonly

Automatic update from web-platform-testsAdd more XMLHttpRequest overrideMimeType() tests

For whatwg/xhr#157, whatwg/xhr#174, and whatwg/mimesniff#42.
--

wpt-commits: ae41496630ba35cff974877498383f1280ca07c2
wpt-pr: 8449
kisg pushed a commit to paul99/webkit-mips that referenced this issue Sep 10, 2018
…ntent-Type" header

https://bugs.webkit.org/show_bug.cgi?id=189465

Patch by Rob Buis <[email protected]> on 2018-09-10
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

* web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt:

Source/WebCore:

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] whatwg/xhr#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):

LayoutTests:

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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@235844 268f45cc-cd09-0410-ab3c-d52691b4dbfc
bertogg pushed a commit to Igalia/webkit that referenced this issue Sep 20, 2018
…e response's "Content-Type" header

https://bugs.webkit.org/show_bug.cgi?id=189465

Patch by Rob Buis <[email protected]> on 2018-09-10
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

* web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt:

Source/WebCore:

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] whatwg/xhr#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):

LayoutTests:

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:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.22@236185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
aperezdc pushed a commit to Igalia/webkit that referenced this issue Oct 8, 2018
…e response's "Content-Type" header

https://bugs.webkit.org/show_bug.cgi?id=189465

Patch by Rob Buis <[email protected]> on 2018-09-10
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

* web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt:

Source/WebCore:

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] whatwg/xhr#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):

LayoutTests:

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:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.22@236185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 2, 2019
…) tests, a=testonly

Automatic update from web-platform-testsAdd more XMLHttpRequest overrideMimeType() tests

For whatwg/xhr#157, whatwg/xhr#174, and whatwg/mimesniff#42.
--

wpt-commits: ae41496630ba35cff974877498383f1280ca07c2
wpt-pr: 8449

UltraBlame original commit: a743786f569a9e77f8c86a2882abee702f58f981
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…) tests, a=testonly

Automatic update from web-platform-testsAdd more XMLHttpRequest overrideMimeType() tests

For whatwg/xhr#157, whatwg/xhr#174, and whatwg/mimesniff#42.
--

wpt-commits: ae41496630ba35cff974877498383f1280ca07c2
wpt-pr: 8449

UltraBlame original commit: a743786f569a9e77f8c86a2882abee702f58f981
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
…) tests, a=testonly

Automatic update from web-platform-testsAdd more XMLHttpRequest overrideMimeType() tests

For whatwg/xhr#157, whatwg/xhr#174, and whatwg/mimesniff#42.
--

wpt-commits: ae41496630ba35cff974877498383f1280ca07c2
wpt-pr: 8449

UltraBlame original commit: a743786f569a9e77f8c86a2882abee702f58f981
JonWBedard pushed a commit to WebKit/WebKit that referenced this issue Dec 1, 2022
…e response's "Content-Type" header

https://bugs.webkit.org/show_bug.cgi?id=189465

Patch by Rob Buis <[email protected]> on 2018-09-10
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

* web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt:

Source/WebCore:

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] whatwg/xhr#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):

LayoutTests:

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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants