Skip to content

Commit

Permalink
Enforce strict MIME type checks for worker-imported scripts
Browse files Browse the repository at this point in the history
This addresses a portion of the proposal in whatwg#3255.
  • Loading branch information
mikewest authored and mustaqahmed committed Feb 15, 2019
1 parent 9df0553 commit 59669fb
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions source
Expand Up @@ -86975,10 +86975,23 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {

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

<li><p>If <var>response</var>'s <span data-x="concept-response-type">type</span> is "<code
data-x="">error</code>", or <var>response</var>'s <span
data-x="concept-response-status">status</span> is not an <span>ok status</span>, throw a
<span>"<code>NetworkError</code>"</span> <code>DOMException</code>.</p></li>
<li>
<p>If any of the following conditions are met, throw a <span>"<code>NetworkError</code>"</span>
<code>DOMException</code>:</p>

<ul class="compact">
<li><p><var>response</var>'s <span data-x="concept-response-type">type</span> is "<code
data-x="">error</code>"</p></li>

<li><p><var>response</var>'s <span data-x="concept-response-status">status</span> is not an
<span>ok status</span></p></li>

<li>
<p>The result of <span data-x="extract a MIME type">extracting a MIME type</span> from
<var>response</var>'s <span data-x="concept-response-header-list">header list</span> is not a
<span>JavaScript MIME type</span></p>
</ul>
</li>

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

0 comments on commit 59669fb

Please sign in to comment.