Skip to content

Commit

Permalink
Honor Content-Type on responses for encoding purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Jun 1, 2022
1 parent cc2afed commit 148e1c9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3093,9 +3093,19 @@ and a <a for=/>response</a> <var>response</var>, is to run these steps:

<p class=note>If there is an exception, <var>response</var> is not JSON. If there is not, it is.

<li><p>Let <var>potentialMIMETypeForEncoding</var> be the result of <a>extracting a MIME type</a>
given <var>response</var>'s <a for=response>header list</a>.

<li>
<p>Let <var>encoding</var> be the result of <a>legacy extracting an encoding</a> given
<var>potentialMIMETypeForEncoding</var> and <var>request</var>'s
<a for=request>no-cors JavaScript fallback encoding</a>.

<p class=note>Equivalently to <a>fetch a classic script</a>, this ignores the
<a for="MIME type" lt=essence>MIME type essence</a>.

<li><p>Let <var>sourceText</var> be the result of <a for=/>decoding</a>
<var>responseBodyBytes</var> given <var>request</var>'s
<a for=request>no-cors JavaScript fallback encoding</a>.
<var>responseBodyBytes</var> given <var>encoding</var>.

<li><p>If <a>ParseText</a>(<var>sourceText</var>, <a>Script</a>) returns a <a>Script Record</a>,
then return true.
Expand Down

0 comments on commit 148e1c9

Please sign in to comment.