|
7 | 7 |
|
8 | 8 | <p><a class="logo" href="https://whatwg.org/"><img alt="WHATWG" height="100" src="https://resources.whatwg.org/logo-fetch.svg" width="100"></a>
|
9 | 9 | <h1 id="cors">Fetch</h1>
|
10 |
| -<h2 class="no-num no-toc" id="living-standard-—-last-updated-15-september-2016">Living Standard — Last Updated 15 September 2016</h2> |
| 10 | +<h2 class="no-num no-toc" id="living-standard-—-last-updated-27-september-2016">Living Standard — Last Updated 27 September 2016</h2> |
11 | 11 |
|
12 | 12 | <dl>
|
13 | 13 | <dt>Participate:
|
@@ -4710,8 +4710,8 @@ <h3 id="request-class"><span class="secno">6.3 </span>Request class</h3>
|
4710 | 4710 |
|
4711 | 4711 | <ol>
|
4712 | 4712 | <li><p>If <var>request</var>'s <a href="#concept-request-mode" title="concept-request-mode">mode</a> is
|
4713 |
| - "<code title="">navigate</code>", <a class="external" data-anolis-spec="webidl" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a |
4714 |
| - <code title="">TypeError</code>. |
| 4713 | + "<code title="">navigate</code>", then set it to "<code>same-origin</code>". |
| 4714 | + <!-- This works because we have reset request's client too. --> |
4715 | 4715 |
|
4716 | 4716 | <li><p>Unset <var>request</var>'s <a href="#omit-origin-header-flag">omit-<code>Origin</code>-header flag</a>.
|
4717 | 4717 |
|
@@ -4745,25 +4745,29 @@ <h3 id="request-class"><span class="secno">6.3 </span>Request class</h3>
|
4745 | 4745 | <a class="external" data-anolis-spec="url" href="https://url.spec.whatwg.org/#concept-url-parser" title="concept-url-parser">parsing</a>
|
4746 | 4746 | <var>referrer</var> with <var>baseURL</var>.
|
4747 | 4747 |
|
4748 |
| - <li><p>If <var>parsedReferrer</var> is failure, |
4749 |
| - <a class="external" data-anolis-spec="webidl" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code title="">TypeError</code>. |
4750 |
| - |
4751 |
| - <li><p>If <var>parsedReferrer</var>'s |
4752 |
| - <a class="external" data-anolis-spec="url" href="https://url.spec.whatwg.org/#non-relative-flag">non-relative flag</a> is set, |
4753 |
| - <a class="external" data-anolis-spec="url" href="https://url.spec.whatwg.org/#concept-url-scheme" title="concept-url-scheme">scheme</a> is |
4754 |
| - "<code>about</code>", and |
4755 |
| - <a class="external" data-anolis-spec="url" href="https://url.spec.whatwg.org/#concept-url-path" title="concept-url-path">path</a> contains a single string |
4756 |
| - "<code>client</code>", set <var>request</var>'s |
4757 |
| - <a href="#concept-request-referrer" title="concept-request-referrer">referrer</a> to "<code>client</code>" and |
4758 |
| - terminate these substeps. |
| 4748 | + <li><p>If <var>parsedReferrer</var> is failure, then <a class="external" data-anolis-spec="webidl" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a |
| 4749 | + <code title="">TypeError</code>. |
4759 | 4750 |
|
4760 |
| - <li><p>If <var>parsedReferrer</var>'s |
4761 |
| - <a class="external" data-anolis-spec="url" href="https://url.spec.whatwg.org/#concept-url-origin" title="concept-url-origin">origin</a> is not |
4762 |
| - <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/browsers.html#same-origin">same origin</a> with <var>origin</var>, |
4763 |
| - <a class="external" data-anolis-spec="webidl" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code title="">TypeError</code>. |
| 4751 | + <li> |
| 4752 | + <p>If one of the following conditions is true, then set <var>request</var>'s |
| 4753 | + <a href="#concept-request-referrer" title="concept-request-referrer">referrer</a> to "<code>client</code>": |
| 4754 | + |
| 4755 | + <ul class="brief"> |
| 4756 | + <li><var>parsedReferrer</var>'s <a class="external" data-anolis-spec="url" href="https://url.spec.whatwg.org/#non-relative-flag">non-relative flag</a> is set, |
| 4757 | + <a class="external" data-anolis-spec="url" href="https://url.spec.whatwg.org/#concept-url-scheme" title="concept-url-scheme">scheme</a> is "<code>about</code>", and |
| 4758 | + <a class="external" data-anolis-spec="url" href="https://url.spec.whatwg.org/#concept-url-path" title="concept-url-path">path</a> contains a single string |
| 4759 | + "<code>client</code>". |
| 4760 | + |
| 4761 | + <li><var>parsedReferrer</var>'s |
| 4762 | + <a class="external" data-anolis-spec="url" href="https://url.spec.whatwg.org/#concept-url-origin" title="concept-url-origin">origin</a> is not |
| 4763 | + <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/browsers.html#same-origin">same origin</a> with <var>origin</var> |
| 4764 | + </ul> |
| 4765 | + <!-- This can happen when you create a fresh request with values from an older request. Throwing |
| 4766 | + would be rather hostile as preventing it requires implementing the same-origin check in |
| 4767 | + developer space. --> |
4764 | 4768 |
|
4765 |
| - <li><p>Set <var>request</var>'s |
4766 |
| - <a href="#concept-request-referrer" title="concept-request-referrer">referrer</a> to <var>parsedReferrer</var>. |
| 4769 | + <li><p>Otherwise, set <var>request</var>'s <a href="#concept-request-referrer" title="concept-request-referrer">referrer</a> |
| 4770 | + to <var>parsedReferrer</var>. |
4767 | 4771 | </ol>
|
4768 | 4772 |
|
4769 | 4773 | <li><p>If <var>init</var>'s <code title="">referrerPolicy</code> member is present, set
|
|
0 commit comments