-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...redirects/test.window.js-serviceworker.js → ...edirects/opaque-redirect-serviceworker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
let evilGlobalState = null; | ||
onfetch = e => { | ||
if(e.request.url.endsWith("test.window.js-redirect.py")) { | ||
if(e.request.url.endsWith("resources/opaque-redirect.py")) { | ||
e.respondWith(new Promise(async resolve => { | ||
evilGlobalState = await fetch(e.request); | ||
resolve(new Response("stage 1 completed\n")); | ||
})); | ||
} else if(e.request.url.endsWith("x/")) { | ||
} else if(e.request.url.endsWith("resources/x/")) { | ||
e.respondWith(evilGlobalState); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
service-workers/redirects/test.window.js → ...rkers/redirects/opaque-redirect.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// META: script=../service-worker/resources/test-helpers.sub.js | ||
|
||
promise_test(async t => { | ||
const reg = await service_worker_unregister_and_register(t, "test.window.js-serviceworker.js", "./"); | ||
const reg = await service_worker_unregister_and_register(t, "opaque-redirect-serviceworker.js", "./"); | ||
t.add_cleanup(async () => await reg.unregister()); | ||
await wait_for_state(t, reg.installing, 'activated'); | ||
const frame = await with_iframe("test.window.js-redirect.py"); | ||
const frame = await with_iframe("resources/opaque-redirect.py"); | ||
assert_equals(frame.contentDocument.body.textContent, "stage 1 completed\n"); | ||
frame.remove(); | ||
const frame2 = await with_iframe("x/"); | ||
const frame2 = await with_iframe("resources/x/"); | ||
assert_equals(frame2.contentDocument.body.textContent, "YAY!\n"); | ||
frame2.remove(); | ||
}, "Passing an (opaque) redirect with a relative URL in its Location header to a second navigation with a different base URL"); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
def main(request, response): | ||
response.status = 302 | ||
response.headers.set("Location", "opaque-redirect-result.txt") |
File renamed without changes.
This file was deleted.
Oops, something went wrong.