Skip to content

Commit

Permalink
Propagate origin and URL list through the Request constructor
Browse files Browse the repository at this point in the history
Tests: WPT service-workers/service-worker/navigation-headers.https.html and service-workers/service-worker/same-site-cookies.https.html.

Fixes #1321 and fixes #1335.

Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
  • Loading branch information
wanderview and annevk committed Dec 1, 2021
1 parent 02b2e8e commit 8e4553b
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6867,7 +6867,7 @@ constructor steps are:

<dl>
<dt><a for=request>URL</a>
<dd><var>request</var>'s <a for=request>current URL</a>.
<dd><var>request</var>'s <a for=request>URL</a>.

<dt><a for=request>method</a>
<dd><var>request</var>'s <a for=request>method</a>.
Expand All @@ -6888,7 +6888,10 @@ constructor steps are:
<dd><var>request</var>'s <a for=request>priority</a>.

<dt><a for=request>origin</a>
<dd>"<code>client</code>".
<dd><var>request</var>'s <a for=request>origin</a>. <span class=note>The propagation of the
<a for=/>origin</a> is only significant for navigation requests being handled by a service
worker. In this scenario a request can have an origin that is different from the current
client.</span>

<dt><a for=request>referrer</a>
<dd><var>request</var>'s <a for=request>referrer</a>.
Expand Down Expand Up @@ -6919,6 +6922,9 @@ constructor steps are:

<dt><a for=request>history-navigation flag</a>
<dd><var>request</var>'s <a for=request>history-navigation flag</a>.

<dt><a for=request>URL list</a>
<dd>A <a for=list>clone</a> of <var>request</var>'s <a for=request>URL list</a>.
</dl>

<li>
Expand All @@ -6933,10 +6939,17 @@ constructor steps are:

<li><p>Unset <var>request</var>'s <a for=request>history-navigation flag</a>.

<li><p>Set <var>request</var>'s <a for=request>referrer</a> to
"<code>client</code>"
<li><p>Set <var>request</var>'s <a for=request>origin</a> to "<code>client</code>".

<li><p>Set <var>request</var>'s <a for=request>referrer</a> to "<code>client</code>".

<li><p>Set <var>request</var>'s <a for=request>referrer policy</a> to the empty string.

<li><p>Set <var>request</var>'s <a for=request>URL</a> to <var>request</var>'s
<a for=request>current URL</a>.

<li><p>Set <var>request</var>'s <a for=request>URL list</a> to « <var>request</var>'s
<a for=request>URL</a> ».
</ol>

<p class=note>This is done to ensure that when a service worker "redirects" a request, e.g., from
Expand Down

0 comments on commit 8e4553b

Please sign in to comment.