Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 148e1c9

Browse files
committedJun 1, 2022
Honor Content-Type on responses for encoding purposes
1 parent cc2afed commit 148e1c9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
 

‎fetch.bs

+12-2
Original file line numberDiff line numberDiff line change
@@ -3093,9 +3093,19 @@ and a <a for=/>response</a> <var>response</var>, is to run these steps:
30933093

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

3096+
<li><p>Let <var>potentialMIMETypeForEncoding</var> be the result of <a>extracting a MIME type</a>
3097+
given <var>response</var>'s <a for=response>header list</a>.
3098+
3099+
<li>
3100+
<p>Let <var>encoding</var> be the result of <a>legacy extracting an encoding</a> given
3101+
<var>potentialMIMETypeForEncoding</var> and <var>request</var>'s
3102+
<a for=request>no-cors JavaScript fallback encoding</a>.
3103+
3104+
<p class=note>Equivalently to <a>fetch a classic script</a>, this ignores the
3105+
<a for="MIME type" lt=essence>MIME type essence</a>.
3106+
30963107
<li><p>Let <var>sourceText</var> be the result of <a for=/>decoding</a>
3097-
<var>responseBodyBytes</var> given <var>request</var>'s
3098-
<a for=request>no-cors JavaScript fallback encoding</a>.
3108+
<var>responseBodyBytes</var> given <var>encoding</var>.
30993109

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

0 commit comments

Comments
 (0)
Please sign in to comment.