summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fenced-frame/resources/check-header-referrer.py
blob: b06fbc270475bcb307d866bad7998829fe5026fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)