diff options
Diffstat (limited to 'testing/web-platform/tests/fenced-frame/resources/check-header-referrer.py')
-rw-r--r-- | testing/web-platform/tests/fenced-frame/resources/check-header-referrer.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fenced-frame/resources/check-header-referrer.py b/testing/web-platform/tests/fenced-frame/resources/check-header-referrer.py new file mode 100644 index 0000000000..b06fbc2704 --- /dev/null +++ b/testing/web-platform/tests/fenced-frame/resources/check-header-referrer.py @@ -0,0 +1,16 @@ +import os + +from wptserve.utils import isomorphic_decode + + +def main(request, response): + response.headers.set(b"supports-loading-mode", b"fenced-frame") + + script = u""" + <script src="utils.js"></script> + <script> + const [referrer_key, _] = parseKeylist(); + writeValueToServer(referrer_key, "%s") + </script> + """ % (isomorphic_decode(request.headers.get(b"referer", b""))) + return (200, [], script) |