Skip to content

Commit

Permalink
Update request's referrer policy when fetching
Browse files Browse the repository at this point in the history
With this change request's referrer policy is updated before calculating referrer so that the referrer policy actually used for the referrer calculation is transferred to the service worker and the default referrer policy is not transferred to the service worker.

Fixes #266.
  • Loading branch information
yutakahirano authored and annevk committed Apr 14, 2016
1 parent 404dc3a commit 2812f6a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Overview.html
Expand Up @@ -7,7 +7,7 @@

<p><a class="logo" href="https://whatwg.org/"><img alt="WHATWG" height="100" src="https://resources.whatwg.org/logo-fetch.svg" width="100"></a>
<h1 id="cors">Fetch</h1>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-10-april-2016">Living Standard — Last Updated 10 April 2016</h2>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-13-april-2016">Living Standard — Last Updated 13 April 2016</h2>

<dl>
<dt>Participate:
Expand Down Expand Up @@ -2101,6 +2101,23 @@ <h3 id="main-fetch"><span class="secno">5.1 </span>Main fetch</h3>
<a href="#refsMIX">[MIX]</a>
<a href="#refsCSP">[CSP]</a>

<li><p>If <var>request</var>'s <a href="#concept-request-referrer-policy" title="concept-request-referrer-policy">referrer policy</a>
is the empty string and <var>request</var>'s
<a href="#concept-request-client" title="concept-request-client">client</a> is non-null, then set <var>request</var>'s
<a href="#concept-request-referrer-policy" title="concept-request-referrer-policy">referrer policy</a> to <var>request</var>'s
<a href="#concept-request-client" title="concept-request-client">client</a>'s
<a href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy">associated referrer policy</a>.
<a href="#refsREFERRER">[REFERRER]</a>

<li>
<p>If <var>request</var>'s <a href="#concept-request-referrer-policy" title="concept-request-referrer-policy">referrer policy</a>
is the empty string, then set <var>request</var>'s
<a href="#concept-request-referrer-policy" title="concept-request-referrer-policy">referrer policy</a> to
"<code>no-referrer-when-downgrade</code>".

<p class="note no-backref">We use "<code>no-referrer-when-downgrade</code>" because it is the
historical default.

<li>
<p>If <var>request</var>'s <a href="#concept-request-referrer" title="concept-request-referrer">referrer</a>
is not "<code>no-referrer</code>", set <var>request</var>'s
Expand Down
17 changes: 17 additions & 0 deletions Overview.src.html
Expand Up @@ -2031,6 +2031,23 @@ <h3>Main fetch</h3>
<span data-anolis-ref>MIX</span>
<span data-anolis-ref>CSP</span>

<li><p>If <var>request</var>'s <span title=concept-request-referrer-policy>referrer policy</span>
is the empty string and <var>request</var>'s
<span title=concept-request-client>client</span> is non-null, then set <var>request</var>'s
<span title=concept-request-referrer-policy>referrer policy</span> to <var>request</var>'s
<span title=concept-request-client>client</span>'s
<a href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy">associated referrer policy</a>.
<span data-anolis-ref>REFERRER</span>

<li>
<p>If <var>request</var>'s <span title=concept-request-referrer-policy>referrer policy</span>
is the empty string, then set <var>request</var>'s
<span title=concept-request-referrer-policy>referrer policy</span> to
"<code>no-referrer-when-downgrade</code>".

<p class="note no-backref">We use "<code>no-referrer-when-downgrade</code>" because it is the
historical default.

<li>
<p>If <var>request</var>'s <span title=concept-request-referrer>referrer</span>
is not "<code>no-referrer</code>", set <var>request</var>'s
Expand Down

0 comments on commit 2812f6a

Please sign in to comment.