Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/redirect.py

Issue 2415873002: Import w3c tests for the service workers (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/redirect.py
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/redirect.py b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/redirect.py
new file mode 100644
index 0000000000000000000000000000000000000000..20521b00c9cae0485678007b83683503512d8356
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/redirect.py
@@ -0,0 +1,25 @@
+def main(request, response):
+ if 'Status' in request.GET:
+ status = int(request.GET["Status"])
+ else:
+ status = 302
+
+ headers = []
+
+ url = request.GET['Redirect']
+ headers.append(("Location", url))
+
+ if "ACAOrigin" in request.GET:
+ for item in request.GET["ACAOrigin"].split(","):
+ headers.append(("Access-Control-Allow-Origin", item))
+
+ for suffix in ["Headers", "Methods", "Credentials"]:
+ query = "ACA%s" % suffix
+ header = "Access-Control-Allow-%s" % suffix
+ if query in request.GET:
+ headers.append((header, request.GET[query]))
+
+ if "ACEHeaders" in request.GET:
+ headers.append(("Access-Control-Expose-Headers", request.GET["ACEHeaders"]))
+
+ return status, headers, ""

Powered by Google App Engine
This is Rietveld 408576698