1
0
Fork 0
firefox/testing/web-platform/tests/resource-timing/resources/content-encoding-headers.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

15 lines
488 B
Python

import os.path
# Return arbitory content-encoding header value.
def read(file):
path = os.path.join(os.path.dirname(__file__), file)
return open(path, u"rb").read()
def main(request, response):
response.headers.set(b"Content-Type", b"text/javascript")
response.content = read(u"./dummy.js")
if b'content_encoding' in request.GET:
content_encoding = request.GET.first(b"content_encoding")
response.headers.set(b"Content-Encoding", content_encoding)