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 Apr 23, 2018
1 parent 811575d commit 7922b6c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3073,6 +3073,9 @@ optional <i>CORS flag</i> and <i>CORS-preflight flag</i>, run these steps:
not "<code>follow</code>" and <var>response</var>'s
<a for=response>url list</a> has more than one item.
</ul>

<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 @@ -3154,10 +3157,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

0 comments on commit 7922b6c

Please sign in to comment.