Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/resources/redirect-scope.py |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/resources/redirect-scope.py b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/resources/redirect-scope.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..88dcc8ebc05c6a3a2bc91a37c3bfe547392f5bec |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/resources/redirect-scope.py |
@@ -0,0 +1,36 @@ |
+def main(request, response): |
+ if "base" in request.GET: |
+ return [("Content-Type", "text/html")], "OK" |
+ type = request.GET.first("type") |
+ |
+ if type == "normal": |
+ response.status = 302 |
+ response.headers.append("Location", "redirect-redirected.html") |
+ response.headers.append("Custom-Header", "hello") |
+ return "" |
+ |
+ if type == "no-location": |
+ response.status = 302 |
+ response.headers.append("Custom-Header", "hello") |
+ return "" |
+ |
+ if type == "no-location-with-body": |
+ response.status = 302 |
+ response.headers.append("Custom-Header", "hello") |
+ return "<body>BODY</body>" |
+ |
+ if type == "redirect-to-scope": |
+ response.status = 302 |
+ response.headers.append("Location", |
+ "redirect-scope.py?type=redirect-to-scope2") |
+ return "" |
+ if type == "redirect-to-scope2": |
+ response.status = 302 |
+ response.headers.append("Location", |
+ "redirect-scope.py?type=redirect-to-scope3") |
+ return "" |
+ if type == "redirect-to-scope3": |
+ response.status = 302 |
+ response.headers.append("Location", "redirect-redirected.html") |
+ response.headers.append("Custom-Header", "hello") |
+ return "" |