Skip to content

Commit

Permalink
Also return an empty string value when a header has no value but is p…
Browse files Browse the repository at this point in the history
…resent
  • Loading branch information
annevk committed Aug 19, 2024
1 parent 941bc4e commit 0334504
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,19 @@ A: nosniff
B: sniff
A:
</code></pre>
<tr>
<td>
<pre><code class=lang-http>
A:
B: sniff
</code></pre>
<td>« "" »
<tr>
<td>
<pre><code class=lang-http>
B: sniff
</code></pre>
<td>null
<tr>
<td>
<pre><code class=lang-http>A: text/html;", x/x</code></pre>
Expand Down Expand Up @@ -763,12 +776,12 @@ a <a for=/>header value</a> <var>value</var>, run these steps. They return a <a
<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>.

<li><p>Let <var>values</var> be a <a for=/>list</a> of <a for=/>strings</a>, initially empty.
<li><p>Let <var>values</var> be a <a for=/>list</a> of <a for=/>strings</a>, initially « ».

<li><p>Let <var>temporaryValue</var> be the empty string.

<li>
<p>While <var>position</var> is not past the end of <var>input</var>:
<p>While true:

<ol>
<li>
Expand All @@ -795,21 +808,13 @@ a <a for=/>header value</a> <var>value</var>, run these steps. They return a <a

<li><p>Set <var>temporaryValue</var> to the empty string.

<li>
<p>If <var>position</var> is not past the end of <var>input</var>:

<ol>
<li><p><a for=/>Assert</a>: the <a for=/>code point</a> at <var>position</var> within
<var>input</var> is U+002C (,).
<li><p>If <var>position</var> is past the end of <var>input</var>, then return <var>values</var>.

<li><p>Advance <var>position</var> by 1.
<li><p><a for=/>Assert</a>: the <a for=/>code point</a> at <var>position</var> within
<var>input</var> is U+002C (,).

<li><p>If <var>position</var> is past the end of <var>input</var>, then <a for=list>append</a>
the empty string to <var>values</var>.
</ol>
<li><p>Advance <var>position</var> by 1.
</ol>

<li><p>Return <var>values</var>.
</ol>

<p class=note>Except for blessed call sites, the algorithm directly above is not to be invoked
Expand Down

0 comments on commit 0334504

Please sign in to comment.