Skip to content

Commit

Permalink
Bug 19797: Rename 'actual media type' back to 'sniffed media type'.
Browse files Browse the repository at this point in the history
  • Loading branch information
GPHemsley committed Nov 1, 2012
1 parent 8fd3b5e commit c7ec25e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 51 deletions.
55 changes: 29 additions & 26 deletions Overview.html
Expand Up @@ -91,7 +91,7 @@ <h2 class="no-num" id="table-of-contents">Table of contents</h2>
<li><a href="#terminology"><span class="secno">3 </span>Terminology</a></li>
<li><a href="#the-specified-media-type"><span class="secno">4 </span>The specified media type</a></li>
<li><a href="#reading-the-resource-header"><span class="secno">5 </span>Reading the resource header</a></li>
<li><a href="#the-actual-media-type"><span class="secno">6 </span>The actual media type</a>
<li><a href="#the-sniffed-media-type"><span class="secno">6 </span>The sniffed media type</a>
<ol>
<li><a href="#text-or-binary-media-type"><span class="secno">6.1 </span>Text or binary media type</a></li>
<li><a href="#unknown-media-type"><span class="secno">6.2 </span>Unknown media type</a>
Expand Down Expand Up @@ -228,7 +228,9 @@ <h2 id="terminology"><span class="secno">3 </span>Terminology</h2>
<a href="#byte" title="byte">bytes</a>.

<p>
A <dfn id="resource-header">resource header</dfn> is the <a href="#byte-sequence">byte sequence</a> at the beginning of a <span>resource</span>, as determined by <a href="#read-the-resource-header" title="read the resource header">reading the resource header</a>.
A <dfn id="resource-header">resource header</dfn> is the <a href="#byte-sequence">byte sequence</a> at the
beginning of a <span>resource</span>, as determined by
<a href="#read-the-resource-header" title="read the resource header">reading the resource header</a>.

<p>
The <dfn id="media-type">media type</dfn> of a resource is a technical hint about the use and
Expand Down Expand Up @@ -310,7 +312,7 @@ <h2 id="terminology"><span class="secno">3 </span>Terminology</h2>
detection algorithm</a>.

<p>
The <dfn id="actual-media-type">actual media type</dfn> of a resource is the <a href="#valid-media-type">valid media
The <dfn id="sniffed-media-type">sniffed media type</dfn> of a resource is the <a href="#valid-media-type">valid media
type</a> of the resource as determined by the <a href="#media-type-sniffing-algorithm">media type sniffing
algorithm</a>.

Expand Down Expand Up @@ -442,11 +444,12 @@ <h2 id="reading-the-resource-header"><span class="secno">5 </span>Reading the re
</ol>

<p class="note">
The <a href="#resource-header">resource header</a> need only be determined once per <span>resource</span>.
The <a href="#resource-header">resource header</a> need only be determined once per
<span>resource</span>.



<h2 id="the-actual-media-type"><span class="secno">6 </span>The actual media type</h2>
<h2 id="the-sniffed-media-type"><span class="secno">6 </span>The sniffed media type</h2>

<p>
The following flags are used in the <a href="#media-type-sniffing-algorithm">media type sniffing
Expand All @@ -461,16 +464,16 @@ <h2 id="the-actual-media-type"><span class="secno">6 </span>The actual media typ
<a href="#media-type-sniffing-algorithm">media type sniffing algorithm</a>.

<p>
To determine the <a href="#actual-media-type">actual media type</a> of a resource, user agents
To determine the <a href="#sniffed-media-type">sniffed media type</a> of a resource, user agents
must use the following <dfn id="media-type-sniffing-algorithm">media type sniffing algorithm</dfn>:

<ol>
<li>
If the <a href="#specified-media-type">specified media type</a> is not null and the <a href="#media-type-portion">media
type portion</a> of the <a href="#specified-media-type">specified media type</a> ends in
"<code title="">+xml</code>" or is equal to "<code title="">text/xml</code>" or
"<code title="">application/xml</code>", the <a href="#actual-media-type">actual media type</a> is
the <a href="#specified-media-type">specified media type</a>.
"<code title="">application/xml</code>", the <a href="#sniffed-media-type">sniffed media type</a>
is the <a href="#specified-media-type">specified media type</a>.

Abort these steps.

Expand Down Expand Up @@ -595,7 +598,7 @@ <h2 id="the-actual-media-type"><span class="secno">6 </span>The actual media typ
if a resource is a feed or HTML</span>.

<li>
The <a href="#actual-media-type">actual media type</a> is the <a href="#specified-media-type">specified media
The <a href="#sniffed-media-type">sniffed media type</a> is the <a href="#specified-media-type">specified media
type</a>.
</ol>

Expand All @@ -615,21 +618,21 @@ <h3 id="text-or-binary-media-type"><span class="secno">6.1 </span>Text or binary
<li>
If <var>length</var> is greater than or equal to 2 and the first 2 bytes of
the <a href="#resource-header">resource header</a> are equal to 0xFE 0xFF (UTF-16BE BOM) or
0xFF 0xFE (UTF-16LE BOM), the <a href="#actual-media-type">actual media type</a> is
0xFF 0xFE (UTF-16LE BOM), the <a href="#sniffed-media-type">sniffed media type</a> is
"<code title="">text/plain</code>".

Abort these steps.

<li>
If <var>length</var> is greater than or equal to 3 and the first 3 bytes of
the <a href="#resource-header">resource header</a> are equal to 0xEF 0xBB 0xBF (UTF-8 BOM),
the <a href="#actual-media-type">actual media type</a> is "<code title="">text/plain</code>".
the <a href="#sniffed-media-type">sniffed media type</a> is "<code title="">text/plain</code>".

Abort these steps.

<li>
If the <a href="#resource-header">resource header</a> contains no
<a href="#binary-data-byte" title="binary data byte">binary data bytes</a>, the <a href="#actual-media-type">actual
<a href="#binary-data-byte" title="binary data byte">binary data bytes</a>, the <a href="#sniffed-media-type">sniffed
media type</a> is "<code title="">text/plain</code>".

Abort these steps.
Expand All @@ -640,8 +643,8 @@ <h3 id="text-or-binary-media-type"><span class="secno">6.1 </span>Text or binary

<p class="warning">
It is critical that the <a href="#rules-for-text-or-binary">rules for distinguishing if a resource is
text or binary</a> never determine the <a href="#actual-media-type">actual media type</a> to
be a <a href="#scriptable-media-type">scriptable media type</a>, as this could allow a privilege
text or binary</a> never determine the <a href="#sniffed-media-type">sniffed media type</a>
to be a <a href="#scriptable-media-type">scriptable media type</a>, as this could allow a privilege
escalation attack.
</ol>

Expand All @@ -657,7 +660,7 @@ <h3 id="unknown-media-type"><span class="secno">6.2 </span>Unknown media type</h
calling the <a href="#rules-for-identifying-an-unknown-media-type">rules for identifying an unknown media type</a>.

<p>
To determine the <a href="#actual-media-type">actual media type</a> of a <span>resource</span>
To determine the <a href="#sniffed-media-type">sniffed media type</a> of a <span>resource</span>
with an unknown <a href="#media-type">media type</a>, execute the following <dfn id="rules-for-identifying-an-unknown-media-type">rules for
identifying an unknown media type</dfn>:

Expand Down Expand Up @@ -694,7 +697,7 @@ <h3 id="unknown-media-type"><span class="secno">6.2 </span>Unknown media type</h
</ul>

<li>
If <var>pattern-matched</var> is true, the <a href="#actual-media-type">actual media type</a>
If <var>pattern-matched</var> is true, the <a href="#sniffed-media-type">sniffed media type</a>
is the value in the fourth column of the current row.

Abort these steps.
Expand All @@ -713,7 +716,7 @@ <h3 id="unknown-media-type"><span class="secno">6.2 </span>Unknown media type</h
Leading <a href="#byte" title="byte">Bytes</a> to Be Ignored
</th>
<th>
<a href="#actual-media-type">Actual Media Type</a>
<a href="#sniffed-media-type">Sniffed Media Type</a>
</th>
<th>
Note
Expand Down Expand Up @@ -789,8 +792,8 @@ <h3 id="unknown-media-type"><span class="secno">6.2 </span>Unknown media type</h
<code title="">text/html</code>
</td>
<td>
The case-insensitive string "<code title="">&lt;SCRIPT</code>" followed by a
<a href="#tag-terminating-byte">tag-terminating byte</a>.
The case-insensitive string "<code title="">&lt;SCRIPT</code>" followed by
a <a href="#tag-terminating-byte">tag-terminating byte</a>.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -1091,8 +1094,8 @@ <h3 id="unknown-media-type"><span class="secno">6.2 </span>Unknown media type</h
</ul>

<li>
If <var>pattern-matched</var> is true, the <a href="#actual-media-type">actual media type</a>
is the value in the fourth column of the current row.
If <var>pattern-matched</var> is true, the <a href="#sniffed-media-type">sniffed media
type</a> is the value in the fourth column of the current row.

Abort these steps.
</ol>
Expand All @@ -1110,7 +1113,7 @@ <h3 id="unknown-media-type"><span class="secno">6.2 </span>Unknown media type</h
Leading <a href="#byte" title="byte">Bytes</a> to Be Ignored
</th>
<th>
<a href="#actual-media-type">Actual Media Type</a>
<a href="#sniffed-media-type">Sniffed Media Type</a>
</th>
<th>
Note
Expand Down Expand Up @@ -1421,28 +1424,28 @@ <h3 id="unknown-media-type"><span class="secno">6.2 </span>Unknown media type</h

However, user agents should not implicitly extend this table to include
additional <a href="#byte-pattern" title="byte pattern">byte patterns</a> for any
<a href="#actual-media-type">actual media type</a> already present in this table, as doing so
<a href="#sniffed-media-type">sniffed media type</a> already present in this table, as doing so
could introduce privilege escalation vulnerabilities.

User agents must not introduce any privilege escalation vulnerabilities
when extending this table.

<li>
If the <a href="#resource-header">resource header</a> <a href="#matches-the-signature-for-mp4">matches the signature for
MP4</a>, the <a href="#actual-media-type">actual media type</a> is
MP4</a>, the <a href="#sniffed-media-type">sniffed media type</a> is
"<code title="">video/mp4</code>".

Abort these steps.

<li>
If the <a href="#resource-header">resource header</a> contains no
<a href="#binary-data-byte" title="binary data byte">binary data bytes</a>, the <a href="#actual-media-type">actual
<a href="#binary-data-byte" title="binary data byte">binary data bytes</a>, the <a href="#sniffed-media-type">sniffed
media type</a> is "<code title="">text/plain</code>".

Abort these steps.

<li>
The <a href="#actual-media-type">actual media type</a> is
The <a href="#sniffed-media-type">sniffed media type</a> is
"<code title="">application/octet-stream</code>".

Abort these steps.
Expand Down
53 changes: 28 additions & 25 deletions Overview.src.html
Expand Up @@ -207,7 +207,9 @@ <h2>Terminology</h2>
<span title=byte>bytes</span>.

<p>
A <dfn>resource header</dfn> is the <span>byte sequence</span> at the beginning of a <span>resource</span>, as determined by <span title="read the resource header">reading the resource header</span>.
A <dfn>resource header</dfn> is the <span>byte sequence</span> at the
beginning of a <span>resource</span>, as determined by
<span title="read the resource header">reading the resource header</span>.

<p>
The <dfn>media type</dfn> of a resource is a technical hint about the use and
Expand Down Expand Up @@ -289,7 +291,7 @@ <h2>Terminology</h2>
detection algorithm</span>.

<p>
The <dfn>actual media type</dfn> of a resource is the <span>valid media
The <dfn>sniffed media type</dfn> of a resource is the <span>valid media
type</span> of the resource as determined by the <span>media type sniffing
algorithm</span>.

Expand Down Expand Up @@ -421,11 +423,12 @@ <h2>Reading the resource header</h2>
</ol>

<p class=note>
The <span>resource header</span> need only be determined once per <span>resource</span>.
The <span>resource header</span> need only be determined once per
<span>resource</span>.



<h2>The actual media type</h2>
<h2>The sniffed media type</h2>

<p>
The following flags are used in the <span>media type sniffing
Expand All @@ -440,16 +443,16 @@ <h2>The actual media type</h2>
<span>media type sniffing algorithm</span>.

<p>
To determine the <span>actual media type</span> of a resource, user agents
To determine the <span>sniffed media type</span> of a resource, user agents
must use the following <dfn>media type sniffing algorithm</dfn>:

<ol>
<li>
If the <span>specified media type</span> is not null and the <span>media
type portion</span> of the <span>specified media type</span> ends in
"<code title>+xml</code>" or is equal to "<code title>text/xml</code>" or
"<code title>application/xml</code>", the <span>actual media type</span> is
the <span>specified media type</span>.
"<code title>application/xml</code>", the <span>sniffed media type</span>
is the <span>specified media type</span>.

Abort these steps.

Expand Down Expand Up @@ -574,7 +577,7 @@ <h2>The actual media type</h2>
if a resource is a feed or HTML</span>.

<li>
The <span>actual media type</span> is the <span>specified media
The <span>sniffed media type</span> is the <span>specified media
type</span>.
</ol>

Expand All @@ -594,21 +597,21 @@ <h3>Text or binary media type</h3>
<li>
If <var>length</var> is greater than or equal to 2 and the first 2 bytes of
the <span>resource header</span> are equal to 0xFE 0xFF (UTF-16BE BOM) or
0xFF 0xFE (UTF-16LE BOM), the <span>actual media type</span> is
0xFF 0xFE (UTF-16LE BOM), the <span>sniffed media type</span> is
"<code title>text/plain</code>".

Abort these steps.

<li>
If <var>length</var> is greater than or equal to 3 and the first 3 bytes of
the <span>resource header</span> are equal to 0xEF 0xBB 0xBF (UTF-8 BOM),
the <span>actual media type</span> is "<code title>text/plain</code>".
the <span>sniffed media type</span> is "<code title>text/plain</code>".

Abort these steps.

<li>
If the <span>resource header</span> contains no
<span title="binary data byte">binary data bytes</span>, the <span>actual
<span title="binary data byte">binary data bytes</span>, the <span>sniffed
media type</span> is "<code title>text/plain</code>".

Abort these steps.
Expand All @@ -619,8 +622,8 @@ <h3>Text or binary media type</h3>

<p class=warning>
It is critical that the <span>rules for distinguishing if a resource is
text or binary</span> never determine the <span>actual media type</span> to
be a <span>scriptable media type</span>, as this could allow a privilege
text or binary</span> never determine the <span>sniffed media type</span>
to be a <span>scriptable media type</span>, as this could allow a privilege
escalation attack.
</ol>

Expand All @@ -636,7 +639,7 @@ <h3>Unknown media type</h3>
calling the <span>rules for identifying an unknown media type</span>.

<p>
To determine the <span>actual media type</span> of a <span>resource</span>
To determine the <span>sniffed media type</span> of a <span>resource</span>
with an unknown <span>media type</span>, execute the following <dfn>rules for
identifying an unknown media type</dfn>:

Expand Down Expand Up @@ -673,7 +676,7 @@ <h3>Unknown media type</h3>
</ul>

<li>
If <var>pattern-matched</var> is true, the <span>actual media type</span>
If <var>pattern-matched</var> is true, the <span>sniffed media type</span>
is the value in the fourth column of the current row.

Abort these steps.
Expand All @@ -692,7 +695,7 @@ <h3>Unknown media type</h3>
Leading <span title=byte>Bytes</span> to Be Ignored
</th>
<th>
<span>Actual Media Type</span>
<span>Sniffed Media Type</span>
</th>
<th>
Note
Expand Down Expand Up @@ -768,8 +771,8 @@ <h3>Unknown media type</h3>
<code title>text/html</code>
</td>
<td>
The case-insensitive string "<code title>&lt;SCRIPT</code>" followed by a
<span>tag-terminating byte</span>.
The case-insensitive string "<code title>&lt;SCRIPT</code>" followed by
a <span>tag-terminating byte</span>.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -1070,8 +1073,8 @@ <h3>Unknown media type</h3>
</ul>

<li>
If <var>pattern-matched</var> is true, the <span>actual media type</span>
is the value in the fourth column of the current row.
If <var>pattern-matched</var> is true, the <span>sniffed media
type</span> is the value in the fourth column of the current row.

Abort these steps.
</ol>
Expand All @@ -1089,7 +1092,7 @@ <h3>Unknown media type</h3>
Leading <span title=byte>Bytes</span> to Be Ignored
</th>
<th>
<span>Actual Media Type</span>
<span>Sniffed Media Type</span>
</th>
<th>
Note
Expand Down Expand Up @@ -1400,28 +1403,28 @@ <h3>Unknown media type</h3>

However, user agents should not implicitly extend this table to include
additional <span title="byte pattern">byte patterns</span> for any
<span>actual media type</span> already present in this table, as doing so
<span>sniffed media type</span> already present in this table, as doing so
could introduce privilege escalation vulnerabilities.

User agents must not introduce any privilege escalation vulnerabilities
when extending this table.

<li>
If the <span>resource header</span> <span>matches the signature for
MP4</span>, the <span>actual media type</span> is
MP4</span>, the <span>sniffed media type</span> is
"<code title>video/mp4</code>".

Abort these steps.

<li>
If the <span>resource header</span> contains no
<span title="binary data byte">binary data bytes</span>, the <span>actual
<span title="binary data byte">binary data bytes</span>, the <span>sniffed
media type</span> is "<code title>text/plain</code>".

Abort these steps.

<li>
The <span>actual media type</span> is
The <span>sniffed media type</span> is
"<code title>application/octet-stream</code>".

Abort these steps.
Expand Down

0 comments on commit c7ec25e

Please sign in to comment.