Execute the following steps for each row row in the following table:
@@ -2466,279 +2458,6 @@ type:
-
Sniffing a mislabeled feed
-
-
- To determine whether a feed has been mislabeled as HTML, execute the
- following rules for distinguishing if a resource is a feed or
- HTML:
-
-
- -
- Let sequence be the resource header, where
- sequence[s] is byte s in
- sequence and sequence[0] is the first
- byte in sequence.
-
-
-
- Let length be the number of bytes in
- sequence.
-
-
-
- Initialize s to 0.
-
-
-
- If length is greater than or equal to 3 and the three
- bytes from sequence[0] to
- sequence[2] are equal to 0xEF 0xBB 0xBF (UTF-8 BOM), increment
- s by 3.
-
-
-
- While s is less than length, continuously loop
- through these steps:
-
-
- -
- Enter loop L:
-
-
- -
- If sequence[s] is undefined, the computed
- MIME type is the supplied MIME type.
-
- Abort these steps.
-
-
-
- If sequence[s] is equal to 0x3C
- ("
<
"), increment s by 1 and exit loop
- L.
-
- -
- If sequence[s] is not a whitespace
- byte, the computed MIME type is the supplied
- MIME type.
-
- Abort these steps.
-
-
-
- Increment s by 1.
-
-
- -
- Enter loop L:
-
-
- -
- If sequence[s] is undefined, the computed
- MIME type is the supplied MIME type.
-
- Abort these steps.
-
-
-
- If length is greater than or equal to s + 3 and
- the three bytes from
- sequence[s] to
- sequence[s + 2] are equal to 0x21 0x2D 0x2D
- ("
!--
"), increment s by 3 and enter loop
- M:
-
-
- -
- If sequence[s] is undefined, the computed
- MIME type is the supplied MIME type.
-
- Abort these steps.
-
-
-
- If length is greater than or equal to s + 3 and
- the three bytes from
- sequence[s] to
- sequence[s + 2] are equal to 0x2D 0x2D 0x3E
- ("
-->
"), increment s by 3 and exit
- loops M and L.
-
- -
- Increment s by 1.
-
-
- -
- If length is greater than or equal to s + 1 and
- sequence[s] is equal to 0x21
- ("
!
"), increment s by 1 and enter loop
- M:
-
-
- -
- If sequence[s] is undefined, the computed
- MIME type is the supplied MIME type.
-
- Abort these steps.
-
-
-
- If length is greater than or equal to s + 1 and
- sequence[s] is equal to 0x3E
- ("
>
"), increment s by 1 and exit loops
- M and L.
-
- -
- Increment s by 1.
-
-
- -
- If length is greater than or equal to s + 1 and
- sequence[s] is equal to 0x3F
- ("
?
"), increment s by 1 and enter loop
- M:
-
-
- -
- If sequence[s] is undefined, the computed
- MIME type is the supplied MIME type.
-
- Abort these steps.
-
-
-
- If length is greater than or equal to s + 2 and
- the two bytes from
- sequence[s] to
- sequence[s + 1] are equal to 0x3F 0x3E
- ("
?>
"), increment s by 2 and exit loops
- M and L.
-
- -
- Increment s by 1.
-
-
- -
- If length is greater than or equal to s + 3 and
- the three bytes from
- sequence[s] to
- sequence[s + 2] are equal to 0x72 0x73 0x73
- ("
rss
"), the computed MIME type is
- "application/rss+xml
".
-
- Abort these steps.
-
- -
- If length is greater than or equal to s + 4 and
- the four bytes from
- sequence[s] to
- sequence[s + 3] are equal to 0x66 0x65 0x65 0x64
- ("
feed
"), the computed MIME type is
- "application/atom+xml
".
-
- Abort these steps.
-
- -
- If length is greater than or equal to s + 7 and
- the seven bytes from
- sequence[s] to
- sequence[s + 6] are equal to 0x72 0x64 0x66 0x3A
- 0x52 0x44 0x46 ("
rdf:RDF
"), increment s
- by 7 and enter loop M:
-
-
- -
- If sequence[s] is undefined, the computed
- MIME type is the supplied MIME type.
-
- Abort these steps.
-
-
-
- If length is greater than or equal to s + 24
- and the twenty-four bytes from
- sequence[s] to
- sequence[s + 23] are equal to 0x68 0x74 0x74
- 0x70 0x3A 0x2F 0x2F 0x70 0x75 0x72 0x6C 0x2E 0x6F 0x72 0x67 0x2F 0x72
- 0x73 0x73 0x2F 0x31 0x2E 0x30 0x2F
- ("
http://purl.org/rss/1.0/
"), increment
- s by 24 and enter loop N:
-
-
- -
- If sequence[s] is undefined, the
- computed MIME type is the supplied MIME
- type.
-
- Abort these steps.
-
-
-
- If length is greater than or equal to s + 43
- and the forty-three bytes from
- sequence[s] to
- sequence[s + 42] are equal to 0x68 0x74 0x74
- 0x70 0x3A 0x2F 0x2F 0x77 0x77 0x77 0x2E 0x77 0x33 0x2E 0x6F 0x72
- 0x67 0x2F 0x31 0x39 0x39 0x39 0x2F 0x30 0x32 0x2F 0x32 0x32 0x2D
- 0x72 0x64 0x66 0x2D 0x73 0x79 0x6E 0x74 0x61 0x78 0x2D 0x6E 0x73
- 0x23
- ("
http://www.w3.org/1999/02/22-rdf-syntax-ns#
"),
- the computed MIME type is
- "application/rss+xml
".
-
- Abort these steps.
-
- -
- Increment s by 1.
-
-
- -
- If length is greater than or equal to s + 24
- and the twenty-four bytes from
- sequence[s] to
- sequence[s + 23] are equal to 0x68 0x74 0x74
- 0x70 0x3A 0x2F 0x2F 0x77 0x77 0x77 0x2E 0x77 0x33 0x2E 0x6F 0x72 0x67
- 0x2F 0x31 0x39 0x39 0x39 0x2F 0x30 0x32 0x2F 0x32 0x32 0x2D 0x72 0x64
- 0x66 0x2D 0x73 0x79 0x6E 0x74 0x61 0x78 0x2D 0x6E 0x73 0x23
- ("
http://www.w3.org/1999/02/22-rdf-syntax-ns#
"),
- increment s by 24 and enter loop N:
-
-
- -
- If sequence[s] is undefined, the
- computed MIME type is the supplied MIME
- type.
-
- Abort these steps.
-
-
-
- If length is greater than or equal to s + 43
- and the forty-three bytes from
- sequence[s] to
- sequence[s + 42] are equal to 0x68 0x74 0x74
- 0x70 0x3A 0x2F 0x2F 0x70 0x75 0x72 0x6C 0x2E 0x6F 0x72 0x67 0x2F
- 0x72 0x73 0x73 0x2F 0x31 0x2E 0x30 0x2F
- ("
http://purl.org/rss/1.0/
"), the computed
- MIME type is "application/rss+xml
".
-
- Abort these steps.
-
- -
- Increment s by 1.
-
-
- -
- Increment s by 1.
-
-
- -
- The computed MIME type is the supplied MIME
- type.
-
- Abort these steps.
-
-
-
- -
- The computed MIME type is the supplied MIME type.
-
-
-
- It might be more efficient for the user agent to implement the rules
- for distinguishing if a resource is a feed or HTML in parallel with
- its algorithm for detecting the character encoding of an HTML document.
-
-
-
Context-specific sniffing