summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/XMLHttpRequest/resources/last-modified.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/XMLHttpRequest/resources/last-modified.py')
-rw-r--r--testing/web-platform/tests/XMLHttpRequest/resources/last-modified.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/testing/web-platform/tests/XMLHttpRequest/resources/last-modified.py b/testing/web-platform/tests/XMLHttpRequest/resources/last-modified.py
new file mode 100644
index 000000000..ef05a6343
--- /dev/null
+++ b/testing/web-platform/tests/XMLHttpRequest/resources/last-modified.py
@@ -0,0 +1,7 @@
+def main(request, response):
+ import datetime, os
+ srcpath = os.path.join(os.path.dirname(__file__), "well-formed.xml")
+ srcmoddt = datetime.datetime.fromtimestamp(os.path.getmtime(srcpath))
+ response.headers.set("Last-Modified", srcmoddt.strftime("%a, %d %b %Y %H:%M:%S GMT"))
+ response.headers.set("Content-Type", "application/xml")
+ return open(srcpath, "r").read()