https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 1497ab6830d6bb9bd5fc1be8623adb8a08ca81a5 authored by Dong-hee Na on 26 October 2018, 10:12:54 UTC
wpt: move tests for value/min/max/low/high/optimum IDL attributes of METER
Tip revision: 1497ab6
echo_client_hints_received.py
def main(request, response):
    """
    Simple handler that sets a response header based on which client hint
    request headers were received.
    """

    response.headers.append("Access-Control-Allow-Origin", "*")

    if "device-memory" in request.headers:
            response.headers.set("device-memory-received", request.headers.get("device-memory"))
    if "dpr" in request.headers:
            response.headers.set("dpr-received", request.headers.get("dpr"))
    if "viewport-width" in request.headers:
            response.headers.set("viewport-width-received", request.headers.get("viewport-width"))
    if "rtt" in request.headers:
            response.headers.set("rtt-received", request.headers.get("rtt"))
    if "downlink" in request.headers:
            response.headers.set("downlink-received", request.headers.get("downlink"))
    if "ect" in request.headers:
            response.headers.set("ect-received", request.headers.get("ect"))
back to top