1
0
Fork 0
firefox/testing/web-platform/tests/fetch/api/resources/status.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

11 lines
436 B
Python

from wptserve.utils import isomorphic_encode
def main(request, response):
code = int(request.GET.first(b"code", 200))
text = request.GET.first(b"text", b"OMG")
content = request.GET.first(b"content", b"")
type = request.GET.first(b"type", b"")
status = (code, text)
headers = [(b"Content-Type", type),
(b"X-Request-Method", isomorphic_encode(request.method))]
return status, headers, content