From 0b6210cd37b68b94252cb798598b12974a20e1c1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 21 May 2024 22:56:19 +0200 Subject: Adding upstream version 5.28.2+dfsg1+~cs23.11.12.3. Signed-off-by: Daniel Baumann --- test/wpt/tests/xhr/resources/last-modified.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/wpt/tests/xhr/resources/last-modified.py (limited to 'test/wpt/tests/xhr/resources/last-modified.py') diff --git a/test/wpt/tests/xhr/resources/last-modified.py b/test/wpt/tests/xhr/resources/last-modified.py new file mode 100644 index 0000000..db08e4b --- /dev/null +++ b/test/wpt/tests/xhr/resources/last-modified.py @@ -0,0 +1,9 @@ +from wptserve.utils import isomorphic_decode, isomorphic_encode + +def main(request, response): + import datetime, os + srcpath = os.path.join(os.path.dirname(isomorphic_decode(__file__)), u"well-formed.xml") + srcmoddt = datetime.datetime.utcfromtimestamp(os.path.getmtime(srcpath)) + response.headers.set(b"Last-Modified", isomorphic_encode(srcmoddt.strftime(u"%a, %d %b %Y %H:%M:%S GMT"))) + response.headers.set(b"Content-Type", b"application/xml") + return open(srcpath, u"r").read() -- cgit v1.2.3