Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define the Content-Type header parser #831

Merged
merged 17 commits into from Nov 27, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 10 additions & 15 deletions fetch.bs
Expand Up @@ -272,8 +272,8 @@ use "<code>deprecated</code>" is not defined by this specification. An

<p>To
<dfn export lt="collect an HTTP quoted string|collecting an HTTP quoted string">collect an HTTP quoted string</dfn>
from a <a for=/>string</a> <var>input</var>, given a <a>position variable</a> <var>position</var>,
run these steps:
from a <a for=/>string</a> <var>input</var>, given a <a>position variable</a> <var>position</var>
and optionally an <var>extract-value flag</var>, run these steps:

<ol>
<li><p>Let <var>positionStart</var> be <var>position</var>.
Expand Down Expand Up @@ -322,15 +322,15 @@ run these steps:
</ol>
</ol>

<li><p>Let <var>collected</var> be the <a for=/>code points</a> from <var>positionStart</var> to
<var>position</var>, inclusive, within <var>input</var>.
<li><p>If the <var>extract-value flag</var> is set, then return <var>value</var>.

<li><p>Return <var>value</var> and <var>collected</var>.
<li><p>Return the <a for=/>code points</a> from <var>positionStart</var> to <var>position</var>,
inclusive, within <var>input</var>.
</ol>

<p class="note no-backref">This returns both the represented value as well as the code points
iterated over to be suitable for <a for="header list">getting, decoding, and splitting</a> and
<a>parse a MIME type</a>, as well as other header value parsers that might need this.
<p class="note no-backref">The <var>extract-value flag</var> makes this algorithm suitable for
<a for="header list">getting, decoding, and splitting</a> and <a>parse a MIME type</a>, as well as
other header value parsers that might need this.


<h4 id=methods>Methods</h4>
Expand Down Expand Up @@ -431,13 +431,8 @@ steps:
U+0022 ("), then:

<ol>
<li>
<p>Let <var>unneeded</var> and <var>collected</var> be the result of
<a>collecting an HTTP quoted string</a> from <var>input</var>, given <var>position</var>.

<p class=note><var>unneeded</var> is ignored for the purposes of this algorithm.

<li><p>Append <var>collected</var> to <var>value</var>.
<li><p>Append the result of <a>collecting an HTTP quoted string</a> from <var>input</var>,
given <var>position</var>, to <var>value</var>.

<li>If <var>position</var> is not past the end of <var>input</var>, then
<a for=iteration>continue</a>.
Expand Down