summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/speculation-rules/prerender/resources/echo-subresource-client-hints-received.py
blob: bb0d128e50313d4a680c4965da982ed98d8e5b14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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")