Re: Header field-name token and leading spaces

Julian Reschke <julian.reschke@gmx.de> Sun, 03 March 2013 19:17 UTC

Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 44B2C21F882F for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 3 Mar 2013 11:17:38 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.92
X-Spam-Level:
X-Spam-Status: No, score=-9.92 tagged_above=-999 required=5 tests=[AWL=0.679, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id STCkcZ1MnKJq for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 3 Mar 2013 11:17:37 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 6AABD21F882E for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sun, 3 Mar 2013 11:17:37 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UCEOK-000276-VI for ietf-http-wg-dist@listhub.w3.org; Sun, 03 Mar 2013 19:16:12 +0000
Resent-Date: Sun, 03 Mar 2013 19:16:12 +0000
Resent-Message-Id: <E1UCEOK-000276-VI@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <julian.reschke@gmx.de>) id 1UCEOB-00026I-00 for ietf-http-wg@listhub.w3.org; Sun, 03 Mar 2013 19:16:03 +0000
Received: from mout.gmx.net ([212.227.17.21]) by lisa.w3.org with esmtp (Exim 4.72) (envelope-from <julian.reschke@gmx.de>) id 1UCEOA-0005e1-2b for ietf-http-wg@w3.org; Sun, 03 Mar 2013 19:16:02 +0000
Received: from mailout-de.gmx.net ([10.1.76.29]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0Lkmp0-1UmOby3yFA-00aUgw for <ietf-http-wg@w3.org>; Sun, 03 Mar 2013 20:15:35 +0100
Received: (qmail invoked by alias); 03 Mar 2013 19:11:37 -0000
Received: from p5DD958C0.dip.t-dialin.net (EHLO [192.168.1.105]) [93.217.88.192] by mail.gmx.net (mp029) with SMTP; 03 Mar 2013 20:11:37 +0100
X-Authenticated: #1915285
X-Provags-ID: V01U2FsdGVkX1+W6RMBHK6WzfMS18cm90RYMrryjLJK/s2Wi3She+ 9wq1hbhx84CbNx
Message-ID: <5133A068.4050200@gmx.de>
Date: Sun, 03 Mar 2013 20:11:36 +0100
From: Julian Reschke <julian.reschke@gmx.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3
MIME-Version: 1.0
To: Karl Dubost <karl@la-grange.net>
CC: HTTP Working Group <ietf-http-wg@w3.org>
References: <02D76B3C-BED4-4E6C-BF72-6ED327FF72E8@la-grange.net>
In-Reply-To: <02D76B3C-BED4-4E6C-BF72-6ED327FF72E8@la-grange.net>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
Received-SPF: pass client-ip=212.227.17.21; envelope-from=julian.reschke@gmx.de; helo=mout.gmx.net
X-W3C-Hub-Spam-Status: No, score=-4.4
X-W3C-Hub-Spam-Report: AWL=-2.479, BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1UCEOA-0005e1-2b 0e28403dcaf920027b1effdd94b855bf
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Header field-name token and leading spaces
Archived-At: <http://www.w3.org/mid/5133A068.4050200@gmx.de>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/16958
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

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