Skip to content

Commit

Permalink
Test when a SW replies with a fetch from a different URL
Browse files Browse the repository at this point in the history
The resulting document's location should be the originally requested
URL.
  • Loading branch information
jyasskin committed Nov 28, 2018
1 parent d021d84 commit 48bb042
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions service-workers/service-worker/navigation-redirect.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,24 @@
'SW-fetched redirect to other-origin in-scope.');


// SW responds with a fetch from a different url.
// SW: event.respondWith(fetch(params['url']));
url2 = SCOPE1;
url1 = SCOPE1 + 'sw=fetch-url&url=' + encodeURIComponent(url2);
redirect_test(
url1,
url1,
[
[
{url: url1, resultingClientIdTag: 'x'}
],
[],
[]
],
'x',
'SW-fetched response from different URL, same-origin same-scope.');


// Opaque redirect.
// SW: event.respondWith(fetch(
// new Request(event.request.url, {redirect: 'manual'})));
Expand Down

0 comments on commit 48bb042

Please sign in to comment.