Skip to content

Commit d1c3679

Browse files
mikewestdomenic
authored andcommitted
Enforce strict MIME type checks for worker-imported scripts
This addresses a portion of the proposal in #3255.
1 parent edc1e95 commit d1c3679

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

source

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86917,10 +86917,23 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
8691786917

8691886918
<li><p>Let <var>response</var> be <var>response</var>'s <span>unsafe response</span>.</p></li>
8691986919

86920-
<li><p>If <var>response</var>'s <span data-x="concept-response-type">type</span> is "<code
86921-
data-x="">error</code>", or <var>response</var>'s <span
86922-
data-x="concept-response-status">status</span> is not an <span>ok status</span>, throw a
86923-
<span>"<code>NetworkError</code>"</span> <code>DOMException</code>.</p></li>
86920+
<li>
86921+
<p>If any of the following conditions are met, throw a <span>"<code>NetworkError</code>"</span>
86922+
<code>DOMException</code>:</p>
86923+
86924+
<ul class="compact">
86925+
<li><p><var>response</var>'s <span data-x="concept-response-type">type</span> is "<code
86926+
data-x="">error</code>"</p></li>
86927+
86928+
<li><p><var>response</var>'s <span data-x="concept-response-status">status</span> is not an
86929+
<span>ok status</span></p></li>
86930+
86931+
<li>
86932+
<p>The result of <span data-x="extract a MIME type">extracting a MIME type</span> from
86933+
<var>response</var>'s <span data-x="concept-response-header-list">header list</span> is not a
86934+
<span>JavaScript MIME type</span></p>
86935+
</ul>
86936+
</li>
8692486937

8692586938
<li><p>Let <var>source text</var> be the result of <span data-x="UTF-8 decode">UTF-8
8692686939
decoding</span> <var>response</var>'s <span data-x="concept-response-body">body</span>.</p></li>

0 commit comments

Comments
 (0)