Re: Header field-name token and leading spaces

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 UTC