Skip to content

Commit

Permalink
Update the ORB spec to align with Firefox's implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
sefeng211 committed May 27, 2024
1 parent 50501ce commit f937b58
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3328,8 +3328,7 @@ and a <a for=/>response</a> <var>response</var>, is to run these steps:
<li><p>If <var>response</var>'s <a for=response>status</a> is 206 and <var>mimeType</var> is an
<a>opaque-response-blocklisted MIME type</a>, then return false.

<li><p>If <var>nosniff</var> is true and <var>mimeType</var> is an
<a>opaque-response-blocklisted MIME type</a> or its <a for="MIME type">essence</a> is
<li><p>If <var>nosniff</var> is true and <var>mimeType</var>'s <a for="MIME type">essence</a> is
"<code>text/plain</code>", then return false.
</ol>

Expand Down Expand Up @@ -3461,6 +3460,7 @@ run these steps:</p>

<hr>

<div algorithm>
<p>To <dfn>obtain a copy of the first 1024 bytes of response</dfn>, given a <a for=/>response</a>
<var>response</var>, run these steps:

Expand Down Expand Up @@ -3522,9 +3522,11 @@ run these steps:</p>

<li>Return <var>first1024Bytes</var>.
</ol>
</div>

<hr>

<div algorithm>
<p>To <dfn>determine if response is JavaScript and not JSON</dfn> given a <a for=/>response</a>
<var>response</var>, run these steps:</p>

Expand Down Expand Up @@ -3580,6 +3582,7 @@ run these steps:</p>

<li><p>Return false.
</ol>
</div>


<h4 id=orb-mime-type-sets>New MIME type sets</h4>
Expand All @@ -3598,12 +3601,14 @@ run these steps:</p>
whose <a for="MIME type">essence</a> is one of:

<ul class=brief>
<li>"<code>application/dash+xml</code>"
<li>"<code>application/gzip</code>"
<li>"<code>application/msexcel</code>"
<li>"<code>application/mspowerpoint</code>"
<li>"<code>application/msword</code>"
<li>"<code>application/msword-template</code>"
<li>"<code>application/pdf</code>"
<li>"<code>application/vnd.apple.mpegurl</code>"
<li>"<code>application/vnd.ces-quickpoint</code>"
<li>"<code>application/vnd.ces-quicksheet</code>"
<li>"<code>application/vnd.ces-quickword</code>"
Expand All @@ -3629,10 +3634,16 @@ whose <a for="MIME type">essence</a> is one of:
<li>"<code>application/x-protobuf</code>"
<li>"<code>application/x-protobuffer</code>"
<li>"<code>application/zip</code>"
<li>"<code>audio/aac</code>"
<li>"<code>audio/aacp</code>"
<li>"<code>audio/mpegurl</code>"
<li>"<code>audio/mpeg</code>"
<li>"<code>multipart/byteranges</code>"
<li>"<code>multipart/signed</code>"
<li>"<code>multipart/x-mixed-replace</code>"
<li>"<code>text/event-stream</code>"
<li>"<code>text/csv</code>"
<li>"<code>text/vtt</code>"
</ul>


Expand Down Expand Up @@ -5638,9 +5649,15 @@ these steps:
<a>HTTP-network-or-cache fetch</a> given <var>fetchParams</var>.

<li><p>If <var>request</var>'s <a for=request>response tainting</a> is "<code>opaque</code>",
<var>response</var>'s <a for=response>status</a> is not a <a>redirect status</a>, and the
<a>opaque-response-safelist check</a> given <var>request</var> and <var>response</var> returns
false, then return a <a>network error</a>.
<var>response</var>'s <a for=response>status</a> is not a <a>redirect status</a>, then

<ol>
<li><p>If <var>request</var>'s <a for=request>initiator type</a> is "<code>fetch</code>",
then set <var>internalResponse</var>'s <a for=response >body</a> to null.

<li><p>Otherwise, if <a>opaque-response-safelist check</a> given <var>request</var> and <var>response</var> returns
false, then return a <a>network error</a>.
</ol>

<li><p>If <var>request</var>'s <a for=request>response tainting</a> is "<code>cors</code>" and
the <a>CORS check</a> for <var>request</var> and <var>response</var> returns failure, then return
Expand Down

0 comments on commit f937b58

Please sign in to comment.