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 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 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 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 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
@annevk annevk closed this 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 <rbuis@igalia.com> 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 <rbuis@igalia.com> 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 <rbuis@igalia.com> 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.