diff options
Diffstat (limited to 'testing/web-platform/tests/client-hints/accept-ch-stickiness/resources/echo-client-hints-received.py')
-rw-r--r-- | testing/web-platform/tests/client-hints/accept-ch-stickiness/resources/echo-client-hints-received.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/client-hints/accept-ch-stickiness/resources/echo-client-hints-received.py b/testing/web-platform/tests/client-hints/accept-ch-stickiness/resources/echo-client-hints-received.py new file mode 100644 index 0000000000..3c61330671 --- /dev/null +++ b/testing/web-platform/tests/client-hints/accept-ch-stickiness/resources/echo-client-hints-received.py @@ -0,0 +1,14 @@ +def main(request, response): + """ + Simple handler that sets a response header based on which client hint + request headers were received. + """ + + response.headers.append(b"Access-Control-Allow-Origin", b"*") + response.headers.append(b"Access-Control-Allow-Headers", b"*") + response.headers.append(b"Access-Control-Expose-Headers", b"*") + + if b"sec-ch-device-memory" in request.headers: + response.headers.set(b"device-memory-received", request.headers.get(b"sec-ch-device-memory")) + if b"device-memory" in request.headers: + response.headers.set(b"device-memory-deprecated-received", request.headers.get(b"device-memory")) |