Index: third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/get-resource-to-cache.py |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/get-resource-to-cache.py b/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/get-resource-to-cache.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ff4254b75197cbd02c870ebc49e1c4bf874e0851 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/get-resource-to-cache.py |
@@ -0,0 +1,14 @@ |
+# A support server that returns a resource to be cached for one year. |
+# |
+# However, if the request contains the "Cache-Control: only-if-cached;" header, |
+# the server returns status code 500, since such a request should never have |
+# reached it. |
+def main(request, response): |
+ if ("Cache-Control" in request._headers and |
+ request._headers["Cache-Control"] == "only-if-cached"): |
+ response.status = 500 # Internal server error. |
+ return |
+ |
+ return ([("Content-Type", "text/plain"), |
+ ("Cache-Control", "max-age=31536000")], |
+ "Resource to be cached for 365 days.") |