diff options
Diffstat (limited to 'test/wpt/tests/service-workers/service-worker/resources/navigation-redirect-scope1.py')
-rw-r--r-- | test/wpt/tests/service-workers/service-worker/resources/navigation-redirect-scope1.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/wpt/tests/service-workers/service-worker/resources/navigation-redirect-scope1.py b/test/wpt/tests/service-workers/service-worker/resources/navigation-redirect-scope1.py new file mode 100644 index 0000000..9b90b14 --- /dev/null +++ b/test/wpt/tests/service-workers/service-worker/resources/navigation-redirect-scope1.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> +''' |