Skip to content

Commit

Permalink
Use request's current url as base URL in redirects
Browse files Browse the repository at this point in the history
As the response's url list is not set at this point using that doesn not work. We could potentially set it earlier, but that brings along other complications that this setup avoid.

This also returns opaque redirect responses earlier, to avoid having them processed twice, which was simply wrong (and would become extra wrong here).

Fixes #631.
  • Loading branch information
annevk committed Nov 20, 2017
1 parent 60db35e commit b5d9ad4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3007,6 +3007,9 @@ optional <i>CORS flag</i> and <i>CORS-preflight flag</i>, run these steps:

<li><p>Execute <a href=https://w3c.github.io/webappsec-csp/#set-response-csp-list>set <var>response</var>'s CSP list</a>
on <var>actualResponse</var>. [[!CSP]]

<li><p>If <var>response</var>'s <a for=response>type</a> is "<code>opaqueredirect</code>", then
return <var>response</var>.
</ol>
</ol>

Expand Down Expand Up @@ -3091,10 +3094,9 @@ optional <i>CORS flag</i> and <i>CORS-preflight flag</i>, run these steps:
<li><p>Let <var>location</var> be the result of <a>extracting header list values</a> given
`<code>Location</code>` and <var>actualResponse</var>'s <a for=response>header list</a>.

<li><p>If <var>location</var> is a <a for=header>value</a>, then set
<var>location</var> to the result of
<a lt="url parser">parsing</a> <var>location</var> with
<var>actualResponse</var>'s <a for=response>url</a>.
<li><p>If <var>location</var> is a <a for=header>value</a>, then set <var>location</var> to the
result of <a lt="url parser">parsing</a> <var>location</var> with <var>request</var>'s
<a for=request>current url</a>.

<li><p>Set <var>actualResponse</var>'s
<a for=response>location URL</a> to <var>location</var>.
Expand Down Expand Up @@ -6077,6 +6079,7 @@ Glenn Maynard,
Graham Klyne,
Hal Lockhart,
Hallvord R. M. Steen,
Harris Hancock,
Henri Sivonen,
Henry Story,
Hiroshige Hayashizaki,
Expand Down

0 comments on commit b5d9ad4

Please sign in to comment.