1
0
Fork 0
firefox/testing/web-platform/tests/loading/early-hints/resources/early-hints-delay.h2.py
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

20 lines
616 B
Python

import time
def handle_headers(frame, request, response):
early_hints = [
(b":status", b"103"),
(b"link", b"</empty.js>; rel=preload; as=script"),
]
time.sleep(int(request.GET.first(b"delay1")) / 1000)
response.writer.write_raw_header_frame(headers=early_hints,
end_headers=True)
time.sleep(int(request.GET.first(b"delay2")) / 1000)
response.status = 200
response.headers[b"content-type"] = "text/html"
response.write_status_headers()
def main(request, response):
response.writer.write_data(item="Hello", last=True)