Skip to content

Commit 126286a

Browse files
authored
Use HTTP whitespace rather than ASCII whitespace
Tests: web-platform-tests/wpt#13615. Fixes #89.
1 parent dc35803 commit 126286a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mimesniff.bs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ a <a>valid MIME type string</a> that does not contain U+003B (;).
217217
<p>To <dfn export>parse a MIME type</dfn>, given a string <var>input</var>, run these steps:
218218

219219
<ol>
220-
<li><p>Remove any leading and trailing <a>ASCII whitespace</a> from <var>input</var>.
220+
<li><p>Remove any leading and trailing <a>HTTP whitespace</a> from <var>input</var>.
221221

222222
<li><p>Let <var>position</var> be a <a for=string>position variable</a> for <var>input</var>,
223223
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 (;).
236236
<li><p>Let <var>subtype</var> be the result of <a>collecting a sequence of code points</a> that are
237237
not U+003B (;) from <var>input</var>, given <var>position</var>.
238238

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

241241
<li><p>If <var>subtype</var> is the empty string or does not solely contain
242242
<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 (;).
252252
<li><p>Advance <var>position</var> to the next <a>code point</a> in <var>input</var>. (This skips
253253
past U+003B (;).)
254254

255-
<li><p><a>Skip ASCII whitespace</a> within <var>input</var> given <var>position</var>.
255+
<li>
256+
<p><a>Collect a sequence of code points</a> that are <a>HTTP whitespace</a> from
257+
<var>input</var> given <var>position</var>.
258+
259+
<p class=note>This is roughly equivalent to <a>skip ASCII whitespace</a>, except that
260+
<a>HTTP whitespace</a> is used rather than <a>ASCII whitespace</a>.
256261

257262
<li><p>Let <var>parameterName</var> be the result of <a>collecting a sequence of code points</a>
258263
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 (;).
333338
<a>collecting a sequence of code points</a> that are not U+003B (;) from <var>input</var>,
334339
given <var>position</var>.
335340

336-
<li><p>Remove any trailing <a>ASCII whitespace</a> from <var>parameterValue</var>.
341+
<li><p>Remove any trailing <a>HTTP whitespace</a> from <var>parameterValue</var>.
337342

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

0 commit comments

Comments
 (0)