diff options
Diffstat (limited to 'testing/web-platform/tests/service-workers/service-worker/resources/navigation-redirect-scope2.py')
-rw-r--r-- | testing/web-platform/tests/service-workers/service-worker/resources/navigation-redirect-scope2.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/navigation-redirect-scope2.py b/testing/web-platform/tests/service-workers/service-worker/resources/navigation-redirect-scope2.py new file mode 100644 index 0000000000..9b90b14695 --- /dev/null +++ b/testing/web-platform/tests/service-workers/service-worker/resources/navigation-redirect-scope2.py @@ -0,0 +1,22 @@ +def main(request, response): + if b"url" in request.GET: + headers = [(b"Location", request.GET[b"url"])] + return 302, headers, b'' + + status = 200 + + if b"noLocationRedirect" in request.GET: + status = 302 + + return status, [(b"content-type", b"text/html")], b''' +<!DOCTYPE html> +<script> +onmessage = event => { + window.parent.postMessage( + { + id: event.data.id, + result: location.href + }, '*'); +}; +</script> +''' |