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

Piotr Dobrogost <p@ietf.dobrogost.net> Tue, 15 January 2013 11:50 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 4A35E21F8726 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 15 Jan 2013 03:50:32 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.977
X-Spam-Level:
X-Spam-Status: No, score=-9.977 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, 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 1ulU0bem8Rnf for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 15 Jan 2013 03:50:31 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id BDE6921F86E8 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 15 Jan 2013 03:50:31 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1Tv50I-0000NG-LV for ietf-http-wg-dist@listhub.w3.org; Tue, 15 Jan 2013 11:48:30 +0000
Resent-Date: Tue, 15 Jan 2013 11:48:30 +0000
Resent-Message-Id: <E1Tv50I-0000NG-LV@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <p.dobrogost@gmail.com>) id 1Tv50E-0000MV-Vf for ietf-http-wg@listhub.w3.org; Tue, 15 Jan 2013 11:48:26 +0000
Received: from mail-qc0-f170.google.com ([209.85.216.170]) by lisa.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <p.dobrogost@gmail.com>) id 1Tv50D-0005HT-Vb for ietf-http-wg@w3.org; Tue, 15 Jan 2013 11:48:26 +0000
Received: by mail-qc0-f170.google.com with SMTP id d42so3202917qca.15 for <ietf-http-wg@w3.org>; Tue, 15 Jan 2013 03:48:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=OPLJvgVLrcP9bKKGzgou+207amVy1xDpSdG5yalM0U8=; b=uZnfI/MtKuB5hDLY/MRlX7pw6EgrF2+y+wo5COdQL2IntEMRXwJpmTqcwAKR+fh0q8 BD4Jo2a/j51vgTN7xAJQxV0FomkX3Mi31kyZrUfbaHUZZgMHWBOrUq9gJZQ3+6XcIvKh BcUyDWpOXQc+IxXdKRM1BIe2JAGwm6xBFgtO4ubN0PIWhkwwRjT2WAKxoPf6mO3dioqU G2hIEO4uKbN58DWCuAevBE3/gZCwQM5NP1V5emxx2vl/0FZV9sLrEYUy7NLOvGR8L3m/ 596lXC9CPmMyLSJThLQ8G/L8XjQEpj+pi2QuH+Vkt1S0NeAaRdN9NxRiVYcEuemVWXK4 2ZuA==
Received: by 10.224.58.66 with SMTP id f2mr75137355qah.11.1358250480089; Tue, 15 Jan 2013 03:48:00 -0800 (PST)
MIME-Version: 1.0
Sender: p.dobrogost@gmail.com
Received: by 10.49.120.138 with HTTP; Tue, 15 Jan 2013 03:47:29 -0800 (PST)
In-Reply-To: <50EDD95C.9080206@gmx.de>
References: <CAA6tFMtOtpu-KJ1PMctU-XqZBXieOgb=uxPNj9wkRBvvbK7iXg@mail.gmail.com> <CACuKZqFWzApgkbQUEgOoNrumJFKSeVFZeCzZgvWDBGukykVqiA@mail.gmail.com> <50ED4DB4.5010803@gmx.de> <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>
From: Piotr Dobrogost <p@ietf.dobrogost.net>
Date: Tue, 15 Jan 2013 12:47:29 +0100
X-Google-Sender-Auth: X2TOvDbBPNr0LOETLF1j4GW7--U
Message-ID: <CAA6tFMsgAKL+-UW6rS0ScxpvukBhJ2ExT9KMWudiKa65YCpkew@mail.gmail.com>
To: ietf-http-wg@w3.org
Content-Type: text/plain; charset="ISO-8859-1"
Received-SPF: pass client-ip=209.85.216.170; envelope-from=p.dobrogost@gmail.com; helo=mail-qc0-f170.google.com
X-W3C-Hub-Spam-Status: No, score=-3.4
X-W3C-Hub-Spam-Report: AWL=-2.711, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1Tv50D-0005HT-Vb a0951c723c226863c1d5709c1a4c9862
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/CAA6tFMsgAKL+-UW6rS0ScxpvukBhJ2ExT9KMWudiKa65YCpkew@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/15874
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>

To summarize, from the point of view of http client library (see
https://github.com/kennethreitz/requests/issues/741):

- The safe approach is to not merge any header fields with the same field name.
- If merging, merge only those fields which are known to be safe to
merge ie. those, which can be parsed after merging. Also, if the top
most production in BNF specyfing field's value is #(values) it does
NOT mean the field is safe for merging although this seems to be
implied by the statement in the spec starting with "Multiple header
fields with the same field name MUST NOT be sent (...)"


Regards,
Piotr