summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/loading/early-hints/resources/delayed-js.h2.py
blob: 93865b930da39216831b33d17bd1bdf0ecb72eed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import importlib

utils = importlib.import_module("loading.early-hints.resources.utils")


def main(request, response):
    id = request.GET.first(b"id")
    # Wait until the id is set via resume-delayed-js.h2.py.
    utils.wait_for_preload_to_finish(request, id)

    headers = [
        ("Content-Type", "text/javascript"),
        ("Cache-Control", "max-age=600"),
    ]
    body = "/*empty script*/"
    return (200, "OK"), headers, body