W3C home > Mailing lists > Public > ietf-http-wg@w3.org > January to March 2013

Re: Header field-name token and leading spaces

From: Julian Reschke <julian.reschke@gmx.de>
Date: Sun, 03 Mar 2013 20:11:36 +0100
Message-ID: <5133A068.4050200@gmx.de>
To: Karl Dubost <karl@la-grange.net>
CC: HTTP Working Group <ietf-http-wg@w3.org>
On 2013-03-03 20:03, Karl Dubost wrote:
> ...
> MY QUESTION (finally) :)
>
> Nothing is said about
> -------------------------------------------------------
> " foo:bar"   (1 or more space/tab before the fied-name)
> -------------------------------------------------------
> ...

It's not a legal field name, thus not a legal start of a header field line.

> In appendix C, the ABNF defines token for:
> http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-22#appendix-C
>
> The section of the spec saying
>
>       field-name     = token
>
> with
>
>     token = 1*tchar
>
> and tchar as
>
>     tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
>      "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
>
>
> So the production rules forbid a leading space, but nothing is said about parsing this leading space.
>
> * Should it say something?
> * If yes, what?
> * If not, why?

It's forbidden by the grammar, so it's invalid.

Best regards, Julian
Received on Sunday, 3 March 2013 19:16:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 3 March 2013 19:16:04 GMT