Skip to content

Commit bf90ed9

Browse files
committed
Define header value inline
HTTP is taking too long to sort this out. Tests: web-platform-tests/wpt#4525. Fixes #332.
1 parent 30aa71f commit bf90ed9

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

fetch.bs

+14-11
Original file line numberDiff line numberDiff line change
@@ -373,21 +373,24 @@ a <a for=/>header list</a> (<var>list</var>), run these steps:
373373
<p>A <dfn export id=concept-header>header</dfn> consists of a
374374
<dfn export for=header id=concept-header-name>name</dfn> and
375375
<dfn export for=header id=concept-header-value>value</dfn>.
376-
A <a for=header>name</a> is a
377-
<a>case-insensitive byte sequence</a> that matches the
378-
<a spec=http>field-name</a> token production. A
379-
<a for=header>value</a> is a byte sequence that matches the
380-
<a spec=http>field-content</a> token production.
381376

382-
<p class=XXX>The definition of <a for=header>value</a>
383-
<a href=https://github.com/whatwg/fetch/issues/332>needs serious work</a>.
377+
<p>A <a for=header>name</a> is a <a>case-insensitive byte sequence</a> that matches the
378+
<a spec=http>field-name</a> token production.
384379

385-
<p class="note no-backref"><a spec=http>field-value</a> allows 0x0A and
386-
0x0D bytes which can lead to reparsing issues.
380+
<p>A <a for=header>value</a> is a <a>byte sequence</a> that matches the following conditions:
381+
382+
<ul class=brief>
383+
<li><p>Has no leading or trailing <a>HTTP whitespace bytes</a>.
384+
<li><p>Contains no 0x00, 0x0A or 0x0D bytes.
385+
</ul>
386+
387+
<p class=note>The definition of <a for=header>value</a> is not defined in terms of an HTTP token
388+
production as
389+
<a href=https://github.com/httpwg/http11bis/issues/19 title="fix field-value ABNF">it is broken</a>.
387390

388391
<p>To <dfn export for=header id=concept-header-value-normalize>normalize</dfn> a
389-
<a for=header>value</a>, remove any leading and trailing
390-
<a>HTTP whitespace bytes</a> from it.
392+
<var>potentialValue</var>, remove any leading and trailing <a>HTTP whitespace bytes</a> from
393+
<var>potentialValue</var>.
391394

392395
<p>A <dfn export for=header id=concept-header-value-combined>combined value</dfn>,
393396
given a <a for=header>name</a> (<var>name</var>) and

0 commit comments

Comments
 (0)