Skip to content

Commit

Permalink
Delete request-body-headers for redirects altering the request method
Browse files Browse the repository at this point in the history
  • Loading branch information
JuniorHsu authored and annevk committed Dec 11, 2019
1 parent 9dd5319 commit 20ec6d0
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions fetch.bs
Expand Up @@ -890,6 +890,16 @@ from APIs using <a for=/>fetch</a> that allow control over
<li>`<code>Set-Cookie2</code>`
</ul>

<p>A <dfn export>request-body-header name</dfn> is a <a for=/>header</a> <a for=header>name</a> that
is a <a>byte-case-insensitive</a> match for one of:

<ul class=brief>
<li>`<code>Content-Encoding</code>`
<li>`<code>Content-Language</code>`
<li>`<code>Content-Location</code>`
<li>`<code>Content-Type</code>`
</ul>

<hr>

<p>To <dfn export lt="extract header values|extracting header values">extract header values</dfn>
Expand Down Expand Up @@ -4028,11 +4038,19 @@ optional <i>CORS-preflight flag</i>, run these steps:
<li><p><var>actualResponse</var>'s <a for=response>status</a> is <code>301</code> or
<code>302</code> and <var>request</var>'s <a for=request>method</a> is `<code>POST</code>`
<li><p><var>actualResponse</var>'s <a for=response>status</a> is <code>303</code> and
<var>request</var>'s <a for=request>method</a> is not `<code>HEAD</code>`
<var>request</var>'s <a for=request>method</a> is not `<code>GET</code>` or `<code>HEAD</code>`
</ul>

<p>then set <var>request</var>'s <a for=request>method</a> to `<code>GET</code>` and
<var>request</var>'s <a for=request>body</a> to null.
<p>then:

<ol>
<li><p>Set <var>request</var>'s <a for=request>method</a> to `<code>GET</code>` and
<var>request</var>'s <a for=request>body</a> to null.

<li><p><a for="list">For each</a> <var>headerName</var> of <a>request-body-header name</a>,
<a for="header list">delete</a> <var>headerName</var> from <var>request</var>'s
<a for=request>header list</a>.
</ol>

<li>
<p>If <var>request</var>'s <a for=request>body</a> is non-null, then set <var>request</var>'s
Expand Down

0 comments on commit 20ec6d0

Please sign in to comment.