summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/cors/resources/cache-304.py
blob: 0626091794063a9a4428e4d36650aafa83a84262 (plain)
1
2
3
4
5
6
7
8
9
10
def main(request, response):
    match = request.headers.get(b"If-None-Match", None)
    if match is not None and match == b"mybestscript-v1":
        response.status = (304, b"YEP")
        return b""
    response.headers.set(b"Access-Control-Allow-Origin", b"*")
    response.headers.set(b"Cache-Control", b"must-revalidate")
    response.headers.set(b"ETag", b"mybestscript-v1")
    response.headers.set(b"Content-Type", b"text/javascript")
    return b"function hep() { }"