summaryrefslogtreecommitdiffstats
path: root/dom/security/test/referrer-policy/file_session_history.sjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/security/test/referrer-policy/file_session_history.sjs
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/security/test/referrer-policy/file_session_history.sjs')
-rw-r--r--dom/security/test/referrer-policy/file_session_history.sjs27
1 files changed, 27 insertions, 0 deletions
diff --git a/dom/security/test/referrer-policy/file_session_history.sjs b/dom/security/test/referrer-policy/file_session_history.sjs
new file mode 100644
index 0000000000..3d5f06b026
--- /dev/null
+++ b/dom/security/test/referrer-policy/file_session_history.sjs
@@ -0,0 +1,27 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function handleRequest(request, response) {
+ if (
+ request.queryString === "check_referrer" &&
+ (!request.hasHeader("referer") ||
+ request.getHeader("referer") !==
+ "https://example.com/browser/dom/security/test/referrer-policy/file_session_history.sjs")
+ ) {
+ response.setStatusLine(request.httpVersion, 400, "Bad Request");
+ response.write("Did not receive referrer");
+ } else {
+ response.setHeader("Content-Type", "text/html");
+ response.write(
+ `<span id="ok">OK</span>
+ <a id="check_referrer" href="?check_referrer">check_referrer</a>
+ <a id="fragment" href="#fragment">fragment</a>
+ <script>
+ function pushState(){
+ history.pushState({}, "", location);
+ }
+ </script>
+ <button id="push_state" onclick="pushState();" >push_state</button>`
+ );
+ }
+}