Skip to content

Commit

Permalink
Allow HTTP scheme fetches to make CORS preflight
Browse files Browse the repository at this point in the history
This allows navigations to make CORS preflight requests, if the
navigation contains a request that is not safelisted. Navigation does
not (yet) provide APIs for non-safelisted requests; this update to the
fetch spec is a prerequisite for HTML spec changes that might add those
APIs (i.e. PUT method support in forms).
  • Loading branch information
alexpetros committed Dec 18, 2024
1 parent bdb452e commit 060cc1d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5106,7 +5106,13 @@ steps:
<p>When in doubt, return a <a>network error</a>.

<dt><a>HTTP(S) scheme</a>
<dd><p>Return the result of running <a>HTTP fetch</a> given <var>fetchParams</var>.
<dd>
<ol>
<li><p>Let <var>forNavigation</var> be true if <a for=request>mode</a> is
<code>navigate</code>; false otherwise.
<li><p>Return the result of running <a>HTTP fetch</a> given <var>fetchParams</var> and
<var>forNavigation</var>.
</ol>
</dl>

<li><p>Return a <a for=/>network error</a>.
Expand All @@ -5118,7 +5124,7 @@ steps:

<div algorithm>
<p>To <dfn export id=concept-http-fetch>HTTP fetch</dfn>, given a <a for=/>fetch params</a>
<var>fetchParams</var> and an optional boolean <var>makeCORSPreflight</var> (default false), run
<var>fetchParams</var> and an optional boolean <var>allowCORS</var> (default false), run
these steps:
<!-- This is exported for service workers, but that specification only mentions it in passing. -->

Expand Down Expand Up @@ -5218,7 +5224,7 @@ these steps:

<ol>
<li>
<p>If <var>makeCORSPreflight</var> is true and one of these conditions is true:
<p>If <var>allowCORS</var> is true and one of these conditions is true:

<ul class=brief>
<li><p>There is no <a>method cache entry match</a> for <var>request</var>'s
Expand Down

0 comments on commit 060cc1d

Please sign in to comment.