From d413e1fb87779a0c3f474f8e773e01ad0878beea Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sat, 23 Jun 2018 04:29:34 +0200 Subject: Bug 1469150 - Tests added to check scripts with valid nonce is allowed if URL redirects (follow up) --- ...dom_security_test_csp_file_nonce_redirector.sjs | 25 ------------ ...dom_security_test_csp_file_nonce_redirects.html | 23 ----------- ...dom_security_test_csp_test_nonce_redirects.html | 47 ---------------------- dom/security/test/csp/file_nonce_redirector.sjs | 25 ++++++++++++ dom/security/test/csp/file_nonce_redirects.html | 23 +++++++++++ dom/security/test/csp/test_nonce_redirects.html | 47 ++++++++++++++++++++++ 6 files changed, 95 insertions(+), 95 deletions(-) delete mode 100644 dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs delete mode 100644 dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html delete mode 100644 dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html create mode 100644 dom/security/test/csp/file_nonce_redirector.sjs create mode 100644 dom/security/test/csp/file_nonce_redirects.html create mode 100644 dom/security/test/csp/test_nonce_redirects.html diff --git a/dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs b/dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs deleted file mode 100644 index 21a8f4e9c..000000000 --- a/dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs +++ /dev/null @@ -1,25 +0,0 @@ -// custom *.sjs file for -// Bug 1469150:Scripts with valid nonce get blocked if URL redirects. - -const URL_PATH = "example.com/tests/dom/security/test/csp/"; - -function handleRequest(request, response) { - response.setHeader("Cache-Control", "no-cache", false); - let queryStr = request.queryString; - - if (queryStr === "redirect") { - response.setStatusLine("1.1", 302, "Found"); - response.setHeader("Location", - "https://" + URL_PATH + "file_nonce_redirector.sjs?load", false); - return; - } - - if (queryStr === "load") { - response.setHeader("Content-Type", "application/javascript", false); - response.write("console.log('script loaded');"); - return; - } - - // we should never get here - return something unexpected - response.write("d'oh"); -} 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 deleted file mode 100644 index e29116490..000000000 --- a/dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Bug 1469150:Scripts with valid nonce get blocked if URL redirects - - - - - - - - diff --git a/dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html b/dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html deleted file mode 100644 index f84fdcc7b..000000000 --- a/dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Bug 1469150:Scripts with valid nonce get blocked if URL redirects - - - - - - - - - - diff --git a/dom/security/test/csp/file_nonce_redirector.sjs b/dom/security/test/csp/file_nonce_redirector.sjs new file mode 100644 index 000000000..21a8f4e9c --- /dev/null +++ b/dom/security/test/csp/file_nonce_redirector.sjs @@ -0,0 +1,25 @@ +// custom *.sjs file for +// Bug 1469150:Scripts with valid nonce get blocked if URL redirects. + +const URL_PATH = "example.com/tests/dom/security/test/csp/"; + +function handleRequest(request, response) { + response.setHeader("Cache-Control", "no-cache", false); + let queryStr = request.queryString; + + if (queryStr === "redirect") { + response.setStatusLine("1.1", 302, "Found"); + response.setHeader("Location", + "https://" + URL_PATH + "file_nonce_redirector.sjs?load", false); + return; + } + + if (queryStr === "load") { + response.setHeader("Content-Type", "application/javascript", false); + response.write("console.log('script loaded');"); + return; + } + + // we should never get here - return something unexpected + response.write("d'oh"); +} diff --git a/dom/security/test/csp/file_nonce_redirects.html b/dom/security/test/csp/file_nonce_redirects.html new file mode 100644 index 000000000..e29116490 --- /dev/null +++ b/dom/security/test/csp/file_nonce_redirects.html @@ -0,0 +1,23 @@ + + + + + + Bug 1469150:Scripts with valid nonce get blocked if URL redirects + + + + + + + + diff --git a/dom/security/test/csp/test_nonce_redirects.html b/dom/security/test/csp/test_nonce_redirects.html new file mode 100644 index 000000000..f84fdcc7b --- /dev/null +++ b/dom/security/test/csp/test_nonce_redirects.html @@ -0,0 +1,47 @@ + + + + + Bug 1469150:Scripts with valid nonce get blocked if URL redirects + + + + + + + + + + -- cgit v1.2.3