summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/resources/navigation-redirect-out-scope.py
blob: 4b40762d89ff05ae56f2a48a2295c47454dc3392 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def main(request, response):
    if "url" in request.GET:
        headers = [("Location", request.GET["url"])]
        return 302, headers, ''

    return [], '''
<!DOCTYPE html>
<script>
  window.parent.postMessage(
      {
        id: 'last_url',
        result: location.href
      }, '*');
</script>
'''