diff options
Diffstat (limited to 'testing/web-platform/tests/referrer-policy/generic/iframe-upgrade-request-to-same-origin.sub.https.html')
-rw-r--r-- | testing/web-platform/tests/referrer-policy/generic/iframe-upgrade-request-to-same-origin.sub.https.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/referrer-policy/generic/iframe-upgrade-request-to-same-origin.sub.https.html b/testing/web-platform/tests/referrer-policy/generic/iframe-upgrade-request-to-same-origin.sub.https.html new file mode 100644 index 0000000000..f9163bec54 --- /dev/null +++ b/testing/web-platform/tests/referrer-policy/generic/iframe-upgrade-request-to-same-origin.sub.https.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<link rel="author" title="Dominic Farolino" href="dom@chromium.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<iframe id="iframe"></iframe> +<script> +async_test(t => { + const iframe = document.querySelector('iframe'); + const insecure_origin = new URL(location.href).origin.replace("https", "http"); + iframe.src = insecure_origin + '/referrer-policy/generic/resources/referrer.py'; + + addEventListener('message', t.step_func_done(msg => { + const referrer = msg.data; + assert_equals(referrer, location.href, + "The referrer header sent for the iframe request should not be redacted"); + })); +}, "If an insecure iframe request is upgraded to https to be same-origin, " + + "referrer policies that consider same-origin-ness should be applied correctly"); +</script> +</body> |