Closed Bug 1523706 Opened 5 years ago Closed 5 years ago

Consider strictly enforcing MIME checks for Worker scripts


(Core :: DOM: Workers, enhancement, P3)




Tracking Status
firefox70 --- fixed


(Reporter: evilpie, Assigned: evilpie)


(Blocks 1 open bug)


(Keywords: dev-doc-complete, site-compat)


(4 files, 1 obsolete file)

It would be good to figure out if we could also restrict the MIME types of worker scripts, instead of just those loaded via importScripts() (Bug 1514680).

I think this issue also still applies:

Component: DOM → DOM: Workers
Assignee: nobody → evilpies

Unless something is wrong with our telemetry I think we should at least try doing this.

This causes quite a lot of test failures: I do think some of those might be unrelated.

Interesting find, seems like for some reason tests in WPT use polygot HTML/JS files ... !!

For example:

Should we change those tests or just disable them for us?

Flags: needinfo?(ckerschb)

(In reply to Tom Schuster [:evilpie] from comment #5)

Should we change those tests or just disable them for us?

From my quick check it seems those usages are not intentional by the authors of the tests and I think we should update them.

Flags: needinfo?(ckerschb)
Depends on: 1557736

I am waiting for review to update some of the WPT tests, but at least a few need to be disabled, because they just don't work when blocking other MIME types.

Keywords: leave-open
Pushed by
Use JavaScript mime type for two worker tests. r=ckerschb
Attachment #9067976 - Attachment description: Bug 1523706 - Consider strictly enforcing MIME checks for Worker scripts → Bug 1523706 - Consider strictly enforcing MIME checks for Worker scripts. r?ckerschb

Depends on D37911

I am going to send an Intent to Ship for this, considering that Chrome seems disinclined to implement this.

Keywords: site-compat
Pushed by
Consider strictly enforcing MIME checks for Worker scripts. r=ckerschb
Disable WPT Worker tests that require a non JavaScript mime. r=ckerschb
Extend devtools test. r=ckerschb
Closed: 5 years ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Blocks: 1569122
Blocks: 1569123

Is there a bug tracking re-enabling the tests that got disabled here?

Flags: needinfo?(evilpies)

Yes, see bug 1569123.

Flags: needinfo?(evilpies)

That's about re-enabling the type checks (which got disabled in bug 1569122). I am talking about things like which disabled various tests.

Flags: needinfo?(evilpies)

hg backout 122642699fc5 worked. See review request.

Flags: needinfo?(evilpies)
Regressions: 1583657

ni myself to fix those tests.

Flags: needinfo?(evilpies)

What should I do about workers/Worker_script_mimetype.htm? It seems like that test uses plaintext on purpose.

Flags: needinfo?(bzbarsky)

That one we should mark as failing on the branches where we have the strict MIME type enforcement (and keep testing that it passes on the branches where we do not have that turned on).

Flags: needinfo?(bzbarsky)

Do we actually have branches with the test changes and not the code/pref changes? Is that situation expected to persist (i.e. is there some part of this that isn't expected to ride the trains?). Typically for things that are on on nightly but not on beta/release we either set the pref unconditionally so the feature is on on all branches, or annotate things like

if release_or_beta: PASS

It sounds like the first option is undesirable here, so the second might be possible. If there are differences between release and beta that need to be annotated I'm not sure what you can do; I can't see a related mozinfo field, but I may be overlooking something obvious.

Blocks: 1595297

Opened bug 1595297 to re-enable those tests.

Flags: needinfo?(evilpies)
Attachment #9094639 - Attachment is obsolete: true
See Also: → 1616237
Regressions: 1748157
Blocks: 1748426
You need to log in before you can comment on or make changes to this bug.