Add a runtime flag to enforce strict MIME type checks for workers.
We're currently enforcing strict MIME type checks for `importScripts()` and nested workers. Firefox would like to enforce them for the top-level worker script as well. We should follow suit. This patch also excludes `blob:`, `filesystem:`, and `data:` from scripty MIME type checks. This is the behavior Firefox is shipping, and seems reasonable, given that the risk of sniffing scripts is highest when dealing with resources delivered from a server, rather than resources which are already accessible to the page causing their execution. https://github.com/whatwg/html/issues/3255 https://bugzilla.mozilla.org/show_bug.cgi?id=1583657 Bug: 794548 Change-Id: Ia55621243b8e279a30f457c6a3a20b9fa13cd3d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1917528 Commit-Queue: Mike West <mkwst@chromium.org> Reviewed-by:Daniel Vogelheim <vogelheim@chromium.org> Cr-Commit-Position: refs/heads/master@{#716121}
Showing
Please register or sign in to comment