summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/speculation-rules/prerender/resources/echo-subresource-client-hints-received.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/speculation-rules/prerender/resources/echo-subresource-client-hints-received.py')
-rw-r--r--testing/web-platform/tests/speculation-rules/prerender/resources/echo-subresource-client-hints-received.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/echo-subresource-client-hints-received.py b/testing/web-platform/tests/speculation-rules/prerender/resources/echo-subresource-client-hints-received.py
new file mode 100644
index 0000000000..bb0d128e50
--- /dev/null
+++ b/testing/web-platform/tests/speculation-rules/prerender/resources/echo-subresource-client-hints-received.py
@@ -0,0 +1,15 @@
+""" Handle the sub-resource requests and attach the received client info to
+the response.
+"""
+
+
+def main(request, response):
+ response.status = 200
+
+ # Echo the received CH headers.
+ response.headers.set(
+ b"server_received_bitness",
+ "true" if b"sec-ch-ua-bitness" in request.headers else "false")
+ response.headers.set(
+ b"server_received_full_version_list", "true"
+ if b"sec-ch-ua-full-version-list" in request.headers else "false")