From 2aa4a82499d4becd2284cdb482213d541b8804dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 16:29:10 +0200 Subject: Adding upstream version 86.0.1. Signed-off-by: Daniel Baumann --- .../test/csp/file_reloadInFreshProcess.sjs | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 dom/security/test/csp/file_reloadInFreshProcess.sjs (limited to 'dom/security/test/csp/file_reloadInFreshProcess.sjs') diff --git a/dom/security/test/csp/file_reloadInFreshProcess.sjs b/dom/security/test/csp/file_reloadInFreshProcess.sjs new file mode 100644 index 0000000000..97e0bcc582 --- /dev/null +++ b/dom/security/test/csp/file_reloadInFreshProcess.sjs @@ -0,0 +1,82 @@ +"use strict"; + +const TESTFRAME_QUERY_LARGE_ALLOCATION_WITH_NO_CSP = + ` + + + Bug 1555050 - Test CSP Navigation using ReloadInFreshProcess + + + testframe
+ + + `; + +const TESTFRAME_QUERY_LARGE_ALLOCATION_WITH_CSP = + ` + + + Bug 1555050 - Test CSP Navigation using ReloadInFreshProcess + + + testframe
+ + + `; + +const LARGE_ALLOCATION = + ` + + + Bug 1555050 - Test CSP Navigation using ReloadInFreshProcess + + + largeAllocation
+ + + `; + +function handleRequest(request, response) +{ + // avoid confusing cache behaviors + response.setHeader("Cache-Control", "no-cache", false); + + var queryString = request.queryString; + + if (queryString == "testframe_with_csp") { + response.setHeader("Content-Security-Policy", "upgrade-insecure-requests", false); + response.write(TESTFRAME_QUERY_LARGE_ALLOCATION_WITH_NO_CSP); + return; + } + + if (queryString == "testframe_with_no_csp") { + response.write(TESTFRAME_QUERY_LARGE_ALLOCATION_WITH_CSP); + return; + } + + if (queryString == "largeAllocation_with_csp") { + response.setHeader("Content-Security-Policy", "upgrade-insecure-requests", false); + response.setHeader("Large-Allocation", "0", false); + response.write(LARGE_ALLOCATION); + return; + } + + if (queryString == "largeAllocation_with_no_csp") { + response.setHeader("Large-Allocation", "0", false); + response.write(LARGE_ALLOCATION); + return; + } + + // we should never get here, but just in case return something unexpected + response.write("do'h"); +} -- cgit v1.2.3