diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-06-21 20:57:09 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-06-21 20:57:09 +0200 |
commit | c1315412cc21a85fb779bef0d87dadde751cfe71 (patch) | |
tree | c21e2ad2a72671f247af3155ba2dee29e7e52b24 /dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html | |
parent | 3f8a6e25520c76304db649c971fe8284bc9c9ab7 (diff) | |
download | UXP-c1315412cc21a85fb779bef0d87dadde751cfe71.tar UXP-c1315412cc21a85fb779bef0d87dadde751cfe71.tar.gz UXP-c1315412cc21a85fb779bef0d87dadde751cfe71.tar.lz UXP-c1315412cc21a85fb779bef0d87dadde751cfe71.tar.xz UXP-c1315412cc21a85fb779bef0d87dadde751cfe71.zip |
Bug 1469150 - CSP: Scripts with valid nonce get blocked if URL redirects
https://bugzilla.mozilla.org/show_bug.cgi?id=1469150
Diffstat (limited to 'dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html')
-rw-r--r-- | dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html b/dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html new file mode 100644 index 000000000..e29116490 --- /dev/null +++ b/dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html @@ -0,0 +1,23 @@ +<!DOCTYPE HTML> +<html> + <head> + <meta charset='utf-8'> + <meta http-equiv="Content-Security-Policy" content="script-src 'nonce-abcd1234'"> + <title>Bug 1469150:Scripts with valid nonce get blocked if URL redirects</title> + </head> +<body> + +<script nonce='abcd1234' id='redirectScript'></script> + +<script nonce='abcd1234' type='application/javascript'> + var redirectScript = document.getElementById('redirectScript'); + redirectScript.onload = function(e) { + window.parent.postMessage({result: 'script-loaded'}, '*'); + }; + redirectScript.onerror = function(e) { + window.parent.postMessage({result: 'script-blocked'}, '*'); + } + redirectScript.src = 'file_nonce_redirector.sjs?redirect'; +</script> +</body> +</html> |