Skip to content
Permalink
Browse files

Use HTTP whitespace rather than ASCII whitespace

  • Loading branch information...
annevk committed Nov 13, 2018
1 parent dc35803 commit 126286ab2dcf3e2d541349ed93539a88bf394ad5
Showing with 9 additions and 4 deletions.
  1. +9 −4 mimesniff.bs
@@ -217,7 +217,7 @@ a <a>valid MIME type string</a> that does not contain U+003B (;).
<p>To <dfn export>parse a MIME type</dfn>, given a string <var>input</var>, run these steps:

<ol>
<li><p>Remove any leading and trailing <a>ASCII whitespace</a> from <var>input</var>.
<li><p>Remove any leading and trailing <a>HTTP whitespace</a> from <var>input</var>.

<li><p>Let <var>position</var> be a <a for=string>position variable</a> for <var>input</var>,
initially pointing at the start of <var>input</var>.
@@ -236,7 +236,7 @@ a <a>valid MIME type string</a> that does not contain U+003B (;).
<li><p>Let <var>subtype</var> be the result of <a>collecting a sequence of code points</a> that are
not U+003B (;) from <var>input</var>, given <var>position</var>.

<li><p>Remove any trailing <a>ASCII whitespace</a> from <var>subtype</var>.
<li><p>Remove any trailing <a>HTTP whitespace</a> from <var>subtype</var>.

<li><p>If <var>subtype</var> is the empty string or does not solely contain
<a>HTTP token code points</a>, then return failure.
@@ -252,7 +252,12 @@ a <a>valid MIME type string</a> that does not contain U+003B (;).
<li><p>Advance <var>position</var> to the next <a>code point</a> in <var>input</var>. (This skips
past U+003B (;).)

<li><p><a>Skip ASCII whitespace</a> within <var>input</var> given <var>position</var>.
<li>
<p><a>Collect a sequence of code points</a> that are <a>HTTP whitespace</a> from
<var>input</var> given <var>position</var>.

<p class=note>This is roughly equivalent to <a>skip ASCII whitespace</a>, except that
<a>HTTP whitespace</a> is used rather than <a>ASCII whitespace</a>.

<li><p>Let <var>parameterName</var> be the result of <a>collecting a sequence of code points</a>
that are not U+003B (;) or U+003D (=) from <var>input</var>, given <var>position</var>.
@@ -333,7 +338,7 @@ a <a>valid MIME type string</a> that does not contain U+003B (;).
<a>collecting a sequence of code points</a> that are not U+003B (;) from <var>input</var>,
given <var>position</var>.

<li><p>Remove any trailing <a>ASCII whitespace</a> from <var>parameterValue</var>.
<li><p>Remove any trailing <a>HTTP whitespace</a> from <var>parameterValue</var>.

<li><p>If <var>parameterValue</var> is the empty string, then <a for=iteration>continue</a>.
</ol>

0 comments on commit 126286a

Please sign in to comment.
You can’t perform that action at this time.