Skip to content

Commit

Permalink
Define header value inline
Browse files Browse the repository at this point in the history
HTTP is taking too long to sort this out.

Tests: web-platform-tests/wpt#4525.

Fixes #332.
  • Loading branch information
annevk committed Jan 12, 2017
1 parent 30aa71f commit bf90ed9
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -373,21 +373,24 @@ a <a for=/>header list</a> (<var>list</var>), run these steps:
<p>A <dfn export id=concept-header>header</dfn> consists of a
<dfn export for=header id=concept-header-name>name</dfn> and
<dfn export for=header id=concept-header-value>value</dfn>.
A <a for=header>name</a> is a
<a>case-insensitive byte sequence</a> that matches the
<a spec=http>field-name</a> token production. A
<a for=header>value</a> is a byte sequence that matches the
<a spec=http>field-content</a> token production.

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

<p class="note no-backref"><a spec=http>field-value</a> allows 0x0A and
0x0D bytes which can lead to reparsing issues.
<p>A <a for=header>value</a> is a <a>byte sequence</a> that matches the following conditions:

<ul class=brief>
<li><p>Has no leading or trailing <a>HTTP whitespace bytes</a>.
<li><p>Contains no 0x00, 0x0A or 0x0D bytes.
</ul>

<p class=note>The definition of <a for=header>value</a> is not defined in terms of an HTTP token
production as
<a href=https://github.com/httpwg/http11bis/issues/19 title="fix field-value ABNF">it is broken</a>.

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

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

0 comments on commit bf90ed9

Please sign in to comment.