summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/client-hints/clear-site-data/resources/check-client-hints.py
blob: 4fc4c331f2cdae227e8bbdbe21885fad42322287 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
Step 2/6 (/client-hints/clear-site-data/clear-site-data-{}.https.html)
Step 3/4 (/client-hints/clear-site-data/set-client-hints-{}-clear-{}.https.html)
"""
def main(request, response):
    if b"sec-ch-device-memory" in request.headers:
        result = u"HadDeviceMemory"
    else:
        result = u"MissingDeviceMemory"
    content = u'''
        <script>
            window.opener.postMessage("%s" , "*");
        </script>''' % (result)
    headers = [(b"Content-Type", b"text/html")]
    return 200, headers, content