1
0
Fork 0
firefox/testing/web-platform/tests/client-hints/clear-site-data/resources/check-client-hints.py
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

15 lines
526 B
Python

"""
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