Skip to content

Commit

Permalink
Accept 'sec-'-prefixed headers as CORS-safelisted.
Browse files Browse the repository at this point in the history
As discussed in #993.
  • Loading branch information
mikewest committed Feb 14, 2020
1 parent d5c3d8b commit 9c64c16
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,11 @@ production as
<li><p>Let <var>value</var> be <var>header</var>'s <a for=header>value</a>.

<li>
<p><a>Byte-lowercase</a> <var>header</var>'s <a for=header>name</a> and switch on the result:
<p>Let <var>name</var> be the result of <a>byte-lowercasing</a> <var>header</var>'s
<a for=header>name</a>.

<li>
<p>Switch on <var>name</var>:

<dl class=switch>
<dt>`<code>accept</code>`
Expand Down Expand Up @@ -760,7 +764,12 @@ fetch("https://victim.example/naïve-endpoint", {
</div>

<dt>Otherwise
<dd><p>Return false.
<dd>
<p>If <var>name</var> does not begin with the string "<code>sec-</code>", return false.

<p class=note>As all headers beginning with "<code>Sec-</code>" are <a>forbidden header
names</a>, we have some confidence that they're generated by the user agent, and not via APIs
that developers directly control.
</dl>

<li><p>If <var>value</var>'s <a for="byte sequence">length</a> is greater than 128, then return
Expand Down

0 comments on commit 9c64c16

Please sign in to comment.