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: 13 additions & 12 deletions fetch.bs
Expand Up @@ -374,8 +374,10 @@ steps:
<ol>
<li><p>Append U+0022 (") to <var>value</var>.

<li><p>Append to <var>value</var> the result of <a>collecting a sequence of code points</a>
that are not U+0022 (") from <var>input</var>, given <var>position</var>.
<li><p>Advance <var>position</var> by 1.

<li><p>Append the result of <a>collecting a sequence of code points</a> that are not
U+0022 (") from <var>input</var>, given <var>position</var>, to <var>value</var>.

<li>
<p>If <var>position</var> is not past the end of <var>input</var>, then:
Expand All @@ -384,10 +386,10 @@ steps:
<li><p>Assert: the <a for=/>code point</a> at <var>position</var> within <var>input</var>
is U+0022 (").
annevk marked this conversation as resolved.
Show resolved Hide resolved

<li><p>Advance <var>position</var> by 1.

<li><p>Append U+0022 (") to <var>value</var>.

<li><p>Advance <var>position</var> by 1.

<li><p><a for=iteration>Continue</a>.
</ol>
</ol>
Expand Down Expand Up @@ -811,6 +813,8 @@ from a <a for=/>header list</a> <var>headers</var>, run these steps:
<a for="header list">getting, decoding, and splitting</a> `<code>Content-Type</code>` from
<var>headers</var>.

<li><p>If <var>values</var> is null, then return failure.

<li>
<p><a for=list>For each</a> <var>value</var> of <var>values</var>:

Expand All @@ -832,14 +836,11 @@ from a <a for=/>header list</a> <var>headers</var>, run these steps:
<li><p>Set <var>essence</var> to <var>mimeType</var>'s <a for="MIME type">essence</a>.
</ol>

<li>
<p>Otherwise, if <var>mimeType</var>'s <a for="MIME type">essence</a> is <var>essence</var>:

<ol>
<li><p>If <var>mimeType</var>'s <a for="MIME type">parameters</a>["<code>charset</code>"] does
not <a for=map>exist</a> and <var>charset</var> is non-null, then set <var>mimeType</var>'s
<a for="MIME type">parameters</a>["<code>charset</code>"] to <var>charset</var>.
</ol>
<li><p>Otherwise, if <var>mimeType</var> is not failure, <var>mimeType</var>'s
<a for="MIME type">essence</a> is <var>essence</var>, <var>mimeType</var>'s
<a for="MIME type">parameters</a>["<code>charset</code>"] does not <a for=map>exist</a>, and
<var>charset</var> is non-null, set <var>mimeType</var>'s
<a for="MIME type">parameters</a>["<code>charset</code>"] to <var>charset</var>.
</ol>

<li><p>Return <var>mimeType</var>.
Expand Down