Re: Multiple header fields with the same field name - unwritten assumption about quoted commas in values?

Amos Jeffries <squid3@treenet.co.nz> Wed, 16 January 2013 09:29 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 D546621F8696 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 16 Jan 2013 01:29:35 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.599
X-Spam-Level:
X-Spam-Status: No, score=-10.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w7CYSnafYCcF for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 16 Jan 2013 01:29:35 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 2F7BD21F868F for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 16 Jan 2013 01:29:34 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1TvPIB-0003TL-5h for ietf-http-wg-dist@listhub.w3.org; Wed, 16 Jan 2013 09:28:19 +0000
Resent-Date: Wed, 16 Jan 2013 09:28:19 +0000
Resent-Message-Id: <E1TvPIB-0003TL-5h@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <squid3@treenet.co.nz>) id 1TvPI7-0003SI-Se for ietf-http-wg@listhub.w3.org; Wed, 16 Jan 2013 09:28:15 +0000
Received: from ip-58-28-153-233.static-xdsl.xnet.co.nz ([58.28.153.233] helo=treenet.co.nz) by lisa.w3.org with esmtp (Exim 4.72) (envelope-from <squid3@treenet.co.nz>) id 1TvPI3-0006gN-2U for ietf-http-wg@w3.org; Wed, 16 Jan 2013 09:28:15 +0000
Received: from [192.168.1.109] (unknown [14.1.64.4]) by treenet.co.nz (Postfix) with ESMTP id 66DC8E70C0 for <ietf-http-wg@w3.org>; Wed, 16 Jan 2013 22:27:44 +1300 (NZDT)
Message-ID: <50F67289.70406@treenet.co.nz>
Date: Wed, 16 Jan 2013 22:27:37 +1300
From: Amos Jeffries <squid3@treenet.co.nz>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
MIME-Version: 1.0
To: ietf-http-wg@w3.org
References: <CAA6tFMtOtpu-KJ1PMctU-XqZBXieOgb=uxPNj9wkRBvvbK7iXg@mail.gmail.com> <CACuKZqHDWbNMiwjkxvBuAt-UEg_tjzEvFZsyXM2U+5H5qxK76A@mail.gmail.com> <50ED9CEF.8080609@gmx.de> <CACuKZqFQ1=0sU7uhnh9_xew5=jPjS3WtEgrtu1RFH+Nu_=FwrQ@mail.gmail.com> <50EDA819.4040402@gmx.de> <CACuKZqH4+JUe4Gqp7LRGkCorFdQ107S=sf2uOSZnMkdgHmJaaQ@mail.gmail.com> <50EDD95C.9080206@gmx.de> <CAA6tFMsgAKL+-UW6rS0ScxpvukBhJ2ExT9KMWudiKa65YCpkew@mail.gmail.com> <50F549D8.2050501@gmx.de> <360A0ACE-4CA6-400A-BFE9-7DFF89AAB439@opera.com> <50F57628.5030502@gmx.de> <BD31B7FE-1CB4-48AD-A119-37A3509EF8E9@opera.com> <6D9EA8FA-50A6-44B1-A2EF-BB428E94183C@mnot.net> <CAK3OfOj8G3gFbTK_vPSnjS0qij+SUB3t9CdG80FYW5tbGgKR3A@mail.gmail.com> <C6A43E78-4F94-4FE3-A049-678555896FEC@mnot.net> <CAA6tFMvNifekQse9H6cbAXxsz1YXNPniW3QmxZo0GdLKZv3i_A@mail.gmail.com> <50F5FA1B.4000401@gmx.de> <CAK3OfOifs_EffAWkK8+FNxU-pOiDUpJP7x0GjxUYQ66YPgvWcw@mail.gmail.com> <CACuKZqFHMNK8yEiq1eJ-JyOk+gSL-Eh=CJyqUTjUSVJvmO55PQ@mail.gmail.com>
In-Reply-To: <CACuKZqFHMNK8yEiq1eJ-JyOk+gSL-Eh=CJyqUTjUSVJvmO55PQ@mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=58.28.153.233; envelope-from=squid3@treenet.co.nz; helo=treenet.co.nz
X-W3C-Hub-Spam-Status: No, score=-1.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1TvPI3-0006gN-2U 1db4482c137de0afd79ac76031cc2279
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Multiple header fields with the same field name - unwritten assumption about quoted commas in values?
Archived-At: <http://www.w3.org/mid/50F67289.70406@treenet.co.nz>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/15905
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 16/01/2013 2:29 p.m., Zhong Yu wrote:
> On Tue, Jan 15, 2013 at 7:02 PM, Nico Williams <nico@cryptonector.com> wrote:
>> On Tue, Jan 15, 2013 at 6:53 PM, Julian Reschke <julian.reschke@gmx.de> wrote:
>>> On 2013-01-16 00:38, Piotr Dobrogost wrote:
>>>> I guess what Nico had in mind is if this subject could be clarified in
>>>> 2.0 so that we won't have problems we have now in the future.
>>>
>>> What problem, exactly?
>>>
>>> Given a valid message, you can combine header fields as specified in the
>>> spec. But you don't have to.
>> You shouldn't if you're a middlebox.
>>
> On the server side, it is a good idea to merge headers. There's no
> point for a server framework to return multiple values for one header
> name - application will have to merge them anyway before parsing.
> (Java Servlet for example does not merge headers; it's a source of
> bug; fortunately clients usually don't split headers)
>
> On the client side, it's probably the same story (except Set-Cookie)

In the middle it is simply difficult to merge correctly without adding 
further mistakes. However for those willing to go to the effort to 
optimize the headers merging can be very useful tool for reducing bytes. 
A warning that many senders still generate corrupted headers may be 
useful but I see no reason to make it a "should not" as these problems 
will face a compliant client as much as any middle box.

Amos