Skip to content

Commit

Permalink
cleanup processing section (#54)
Browse files Browse the repository at this point in the history
- Keep no-cors mode if Content-Type is null
- Declare var's before setting them

Closes #53.
  • Loading branch information
igrigorik committed Sep 11, 2017
1 parent af4b8c2 commit d46efe0
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions index.html
Expand Up @@ -396,12 +396,14 @@ <h2>Processing Model</h2>
"http" or "https", <a>throw</a> a "<code><a>TypeError</a></code>"
exception and terminate these steps.</p>
</li>
<li>Let <var>headerList</var> be an empty list.</li>
<li>Let <var>corsMode</var> be "<code>no-cors</code>".</li>
<li>
<p>If <var>data</var> is not <code>null</code>:</p>
<ul>
<ol>
<li>
<a>Extract</a> object's byte stream (<var>transmittedData</var>)
and MIME type (<var>mimeType</var>).
and content type (<var>contentType</var>).
</li>
<li>If the amount of data that can be queued to be sent by
<a href="#concept-keep-alive-flag">keepalive</a> enabled requests
Expand All @@ -414,19 +416,18 @@ <h2>Processing Model</h2>
the same flag manually when using the Fetch API. All requests with
this flag set share the same in-flight quota restrictions that is
enforced within the Fetch API.</p>
<li>Let <var>corsMode</var> be "<code>cors</code>".</li>
<li>Let <var>headerList</var> be <code>null</code>.</li>
</ul>
</li>
<li>If <var>mimeType</var> is not null:
<ul>
<li>If <var>mimeType</var> value is a <a>CORS-safelisted
request-header</a> value for the <code>Content-Type</code> header,
set <var>corsMode</var> to "<code>no-cors</code>".
<li>If <var>contentType</var> is not null:
<ul>
<li>Set <var>corsMode</var> to "<code>cors</code>".</li>
<li>If <var>contentType</var> value is a <a>CORS-safelisted
request-header</a> value for the <code>Content-Type</code>
header, set <var>corsMode</var> to "<code>no-cors</code>".
</li>
<li>Append a <code>Content-Type</code> header with value
<var>contentType</var> to <var>headerList</var>.</li>
</ul>
</li>
<li>Append a <code>Content-Type</code> header with value
<var>mimeType</var> to <var>headerList</var>.</li>
</ul>
</ol>
</li>
<li>Set the return value to <code>true</code>, return the
<a>sendBeacon()</a> call, and continue to run the following steps in
Expand Down

0 comments on commit d46efe0

Please sign in to comment.