Add MIME type checking for HTTP(S) worker scripts#5302
Conversation
|
I could fix up this test: https://github.com/web-platform-tests/wpt/blob/master/workers/Worker_script_mimetype.htm |
|
Thanks! I'd be interested in also getting tests for blob/data (maybe not filesystem), since it sounds like at least at one point in time those were treated differently... |
Yes, right. We only enforce the MIME type for HTTP loads at the moment. This is the case we most care about anyway. One exception is module loads where we enforce the right MIME type also at the script loader level, so it also applies to data: and blob:. I think we are not generally opposed to also fixing those, but it's not a priority. |
|
We have delayed shipping this change in light of the current events. |
|
We now intent to ship this in Firefox 81. |
|
Great! Is the plan still to not enforce this for |
|
I think for For tests is there anything we could just copy or extend? I think when I first did this a year ago I fixed all WPT tests that were unintentionally using the wrong mime type for workers. |
|
Alright, I'll rebase this and add carve-outs for data: and blob: URLs, although doing so makes me sad. Fixing existing tests sounds great. Just send me a link to the web-platform-tests/wpt pull request, or Firefox change that will eventually get synced there, so we can link the changes there to this PR. |
|
So for reference purposes:
|
|
Working on precise spec text... what's the plan for |
5307855 to
5c15a90
Compare
|
Alright, I've got the pull request all straightened out, assuming that we're specifically exempting For tests, we'll want a pull request/Firefox-side change for the https://github.com/web-platform-tests/wpt/blob/master/workers/Worker_script_mimetype.htm test you mentioned. It'd also be ideal to add specific tests (e.g. by expanding that test file) for:
|
|
Right now the Firefox implementation is restricted to blocking bad scripts coming from |
|
OK cool, I'll switch around the PR. In that case we should have tests to check that |
5c15a90 to
6a5c732
Compare
This is part of #3255.
6a5c732 to
1a90195
Compare
|
I'll wait on merging until we have some test updates ready to go. |
|
I'm updating the tests now; I'll update the OP with a link to the test pull request, and then merge. It turns out that |
…ing tests, a=testonly Automatic update from web-platform-tests Update and expand worker MIME type checking tests Follows whatwg/html#5302. -- wpt-commits: 031409f5be576b09f592f114e50c241db96820c5 wpt-pr: 24983
…ing tests, a=testonly Automatic update from web-platform-tests Update and expand worker MIME type checking tests Follows whatwg/html#5302. -- wpt-commits: 031409f5be576b09f592f114e50c241db96820c5 wpt-pr: 24983
…ing tests, a=testonly Automatic update from web-platform-tests Update and expand worker MIME type checking tests Follows whatwg/html#5302. -- wpt-commits: 031409f5be576b09f592f114e50c241db96820c5 wpt-pr: 24983
This is part of #3255.
This is on top of #5774.
(See WHATWG Working Mode: Changes for more details.)
/webappapis.html ( diff )