Skip to content

Commit

Permalink
CSP2/CSP3: ASCII case-insensitive.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewest committed Jan 20, 2015
1 parent 8cbfd69 commit 7881077
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
30 changes: 16 additions & 14 deletions specs/CSP2/index.src.html
Expand Up @@ -74,6 +74,7 @@ <h1>Content Security Policy Level 2</h1>
text: split a string on spaces
text: strip leading and trailing whitespace
text: firing; url: concept-event-fire
text: ascii case-insensitive match; url: ascii-case-insensitive
urlPrefix: links.html
text: icon; url: rel-icon
text: link type stylesheet
Expand Down Expand Up @@ -1044,9 +1045,9 @@ <h4 id="match-source-expression">Matching Source Expressions</h4>

<ol>
<li>
If <var>url</var>'s <a>scheme</a> is a case-insensitive match
for the source expression's <code><a>scheme-part</a></code>,
return <em>does match</em>.
If <var>url</var>'s <a>scheme</a> is an <a>ASCII case-insensitive
match</a> for the source expression's
<code><a>scheme-part</a></code>, return <em>does match</em>.
</li>

<li>
Expand Down Expand Up @@ -1406,16 +1407,16 @@ <h4 id="source-list-valid-hashes">Valid Hashes</h4>
<li>Let <var>algorithm</var> be:
<ul>
<li><a>SHA-256</a> if the <code><a>hash-algo</a></code>
component of <var>hash</var> is a case-insensitive match for
the string "sha256" or "sha-256"</li>
component of <var>hash</var> is an <a>ASCII case-insensitive
match</a> for the string "sha256" or "sha-256"</li>

<li><a>SHA-384</a> if the <code><a>hash-algo</a></code>
component of <var>hash</var> is a case-insensitive match for
the string "sha384" or "sha-384"</li>
component of <var>hash</var> is an <a>ASCII case-insensitive
match</a> for the string "sha384" or "sha-384"</li>

<li><a>SHA-512</a> if the <code><a>hash-algo</a></code>
component of <var>hash</var> is a case-insensitive match for
the string "sha512" or "sha-512"</li>
component of <var>hash</var> is an <a>ASCII case-insensitive
match</a> for the string "sha512" or "sha-512"</li>
</ul>
</li>

Expand Down Expand Up @@ -1485,9 +1486,10 @@ <h4 id="media-type-list-parsing">Parsing</h4>
<h4 id="media-type-list-matching">Matching</h4>

A media type <dfn title="match a media type list">matches a media type
list</dfn> if, and only if, the media type is a case-insensitive match for
at least one token in the set of media types obtained by
<a title="parse a media type list">parsing the media type list</a>.
list</dfn> if, and only if, the media type is an <a>ASCII
case-insensitive match</a> for at least one token in the set of media
types obtained by <a title="parse a media type list">parsing the media
type list</a>.
</section>
</section>
<section>
Expand Down Expand Up @@ -2697,12 +2699,12 @@ <h3 id="directive-plugin-types"><code>plugin-types</code></h3>
<code><a element>object</a></code> or
<code><a element>embed</a></code> element, and the media type declared
in the element's <code><a element-attr>type</a></code> attribute is not
a case-insensitive match for the <var>resource</var>'s media
an <a>ASCII case-insensitive match</a> for the <var>resource</var>'s media
type.</li>

<li>The plugin is embedded into the protected resource via an
<code><a element>applet</a></code> element, and <var>resource</var>'s
media type is not a case-insensitive match for
media type is not an <a>ASCII case-insensitive match</a> for
<code>application/x-java-applet</code>.</li>
</ul>

Expand Down
30 changes: 16 additions & 14 deletions specs/content-security-policy/index.src.html
Expand Up @@ -74,6 +74,7 @@ <h1>Content Security Policy</h1>
text: split a string on spaces
text: strip leading and trailing whitespace
text: firing; url: concept-event-fire
text: ascii case-insensitive match; url: ascii-case-insensitive
urlPrefix: links.html
text: icon; url: rel-icon
text: link type stylesheet
Expand Down Expand Up @@ -1062,9 +1063,9 @@ <h4 id="match-source-expression">Matching Source Expressions</h4>

<ol>
<li>
If <var>url</var>'s <a>scheme</a> is a case-insensitive match
for the source expression's <code><a>scheme-part</a></code>,
return <em>does match</em>.
If <var>url</var>'s <a>scheme</a> is an <a>ASCII case-insensitive
match</a> for the source expression's
<code><a>scheme-part</a></code>, return <em>does match</em>.
</li>

<li>
Expand Down Expand Up @@ -1425,16 +1426,16 @@ <h4 id="source-list-valid-hashes">Valid Hashes</h4>
<li>Let <var>algorithm</var> be:
<ul>
<li><a>SHA-256</a> if the <code><a>hash-algo</a></code>
component of <var>hash</var> is a case-insensitive match for
the string "sha256" or "sha-256"</li>
component of <var>hash</var> is an <a>ASCII case-insensitive
match</a> for the string "sha256" or "sha-256"</li>

<li><a>SHA-384</a> if the <code><a>hash-algo</a></code>
component of <var>hash</var> is a case-insensitive match for
the string "sha384" or "sha-384"</li>
component of <var>hash</var> is an <a>ASCII case-insensitive
match</a> for the string "sha384" or "sha-384"</li>

<li><a>SHA-512</a> if the <code><a>hash-algo</a></code>
component of <var>hash</var> is a case-insensitive match for
the string "sha512" or "sha-512"</li>
component of <var>hash</var> is an <a>ASCII case-insensitive
match</a> for the string "sha512" or "sha-512"</li>
</ul>
</li>

Expand Down Expand Up @@ -1504,9 +1505,10 @@ <h4 id="media-type-list-parsing">Parsing</h4>
<h4 id="media-type-list-matching">Matching</h4>

A media type <dfn title="match a media type list">matches a media type
list</dfn> if, and only if, the media type is a case-insensitive match for
at least one token in the set of media types obtained by
<a title="parse a media type list">parsing the media type list</a>.
list</dfn> if, and only if, the media type is an <a>ASCII
case-insensitive match</a> for at least one token in the set of media
types obtained by <a title="parse a media type list">parsing the media
type list</a>.
</section>
</section>
<section>
Expand Down Expand Up @@ -2851,12 +2853,12 @@ <h3 id="directive-plugin-types"><code>plugin-types</code></h3>
<code><a element>object</a></code> or
<code><a element>embed</a></code> element, and the media type declared
in the element's <code><a element-attr>type</a></code> attribute is not
a case-insensitive match for the <var>resource</var>'s media
an <a>ASCII case-insensitive match</a> for the <var>resource</var>'s media
type.</li>

<li>The plugin is embedded into the protected resource via an
<code><a element>applet</a></code> element, and <var>resource</var>'s
media type is not a case-insensitive match for
media type is not an <a>ASCII case-insensitive match</a> for
<code>application/x-java-applet</code>.</li>
</ul>

Expand Down

0 comments on commit 7881077

Please sign in to comment.