diff options
author | New Tobin Paradigm <email@mattatobin.com> | 2018-04-12 10:49:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 10:49:23 -0400 |
commit | 4c2e77404f43040ce7a9f0d9052448b3f23a8c28 (patch) | |
tree | d7161a645a98f38dd18797cc80581446929f99c7 /dom/security/test | |
parent | a0968fc6a86c8ab1abfa83d3c1986fadf3ec2766 (diff) | |
parent | 9f7f0f1172d67ab29e4f72eb1b34ab6f4bb231b1 (diff) | |
download | UXP-4c2e77404f43040ce7a9f0d9052448b3f23a8c28.tar UXP-4c2e77404f43040ce7a9f0d9052448b3f23a8c28.tar.gz UXP-4c2e77404f43040ce7a9f0d9052448b3f23a8c28.tar.lz UXP-4c2e77404f43040ce7a9f0d9052448b3f23a8c28.tar.xz UXP-4c2e77404f43040ce7a9f0d9052448b3f23a8c28.zip |
Merge pull request #126 from janekptacijarabaci/js_X-Content-Type-Options_nosniff_json_1
Align XCTO: nosniff allowed script MIME types with the spec
Diffstat (limited to 'dom/security/test')
-rw-r--r-- | dom/security/test/csp/file_child-src_worker-redirect.html | 7 | ||||
-rw-r--r-- | dom/security/test/general/test_block_script_wrong_mime.html | 6 |
2 files changed, 2 insertions, 11 deletions
diff --git a/dom/security/test/csp/file_child-src_worker-redirect.html b/dom/security/test/csp/file_child-src_worker-redirect.html index 188f173b8..b0029935c 100644 --- a/dom/security/test/csp/file_child-src_worker-redirect.html +++ b/dom/security/test/csp/file_child-src_worker-redirect.html @@ -23,11 +23,8 @@ ); worker.onerror = function(error) { - var msg = error.message; - if (msg.match(/^NetworkError/) || msg.match(/Failed to load worker script/)) { - // this means CSP blocked it - msg = "blocked"; - } + // this means CSP blocked it + var msg = !("message" in error) ? "blocked" : e.message; window.parent.postMessage({id:page_id, message:msg}, 'http://mochi.test:8888'); error.preventDefault(); }; diff --git a/dom/security/test/general/test_block_script_wrong_mime.html b/dom/security/test/general/test_block_script_wrong_mime.html index f4da9c577..34d4b621b 100644 --- a/dom/security/test/general/test_block_script_wrong_mime.html +++ b/dom/security/test/general/test_block_script_wrong_mime.html @@ -53,9 +53,6 @@ function testWorker([mime, shouldLoad]) { }; worker.onerror = (error) => { ok(!shouldLoad, `worker with wrong mime '${mime}' should be blocked`); - let msg = error.message; - ok(msg.match(/^NetworkError/) || msg.match(/Failed to load worker script/), - "should gets correct error message"); error.preventDefault(); resolve(); } @@ -74,9 +71,6 @@ function testWorkerImportScripts([mime, shouldLoad]) { }; worker.onerror = (error) => { ok(!shouldLoad, `worker/importScripts with wrong mime '${mime}' should be blocked`); - let msg = error.message; - ok(msg.match(/^NetworkError/) || msg.match(/Failed to load worker script/), - "should gets correct error message"); error.preventDefault(); resolve(); } |