Re: draft-ietf-httpbis-header-structure: handling multiple field values

Ian Clelland <iclelland@google.com> Tue, 12 May 2020 17:41 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@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 AE3793A082B for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 12 May 2020 10:41:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.248
X-Spam-Level:
X-Spam-Status: No, score=-10.248 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NXsmi8-qy5Hp for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 12 May 2020 10:41:11 -0700 (PDT)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 05E323A0835 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 12 May 2020 10:41:10 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1jYYsb-00045e-3Q for ietf-http-wg-dist@listhub.w3.org; Tue, 12 May 2020 17:39:45 +0000
Resent-Date: Tue, 12 May 2020 17:39:45 +0000
Resent-Message-Id: <E1jYYsb-00045e-3Q@lyra.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) by lyra.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <iclelland@google.com>) id 1jYYsa-00044o-4E for ietf-http-wg@listhub.w3.org; Tue, 12 May 2020 17:39:44 +0000
Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by mimas.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <iclelland@google.com>) id 1jYYsY-0006Gp-M7 for ietf-http-wg@w3.org; Tue, 12 May 2020 17:39:44 +0000
Received: by mail-ej1-x634.google.com with SMTP id x20so8164602ejb.11 for <ietf-http-wg@w3.org>; Tue, 12 May 2020 10:39:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=m3fyZfFfPmDJ0Yylncjf2e+ZjzcnyDZ+wneYBJr+sPY=; b=Q7m08Hi+ShVthyOwxfBduf+KGW2yeaLEUW4tT24AnitqekfDBtj5E3PW7yHlsMS7mO OiT9FIVWR/pJXqi/sMOehEG4EVwhqehuW2/WNje31lXqotI5q07zSK+0UoCrr03Nb19c JUy59NfzvmsUD3fO+A4L6Iy1tUFmH81LwedFj4GofMUMiccYL9xPSEfaALR0G/Z4jY7I qzOQ6vI8Y3Sj5vvxbv0QwtPxG2vRQFt5rzVujM/DSgRvI+WHyTGy29CHzq3hJ5MRlEyt TT8HXkVb40whcuD00vop+fxQYfA8HQi2QgqLI/Ett5C5N/vZP0U9uQIeDyr3xBXa0UDd Z6hQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=m3fyZfFfPmDJ0Yylncjf2e+ZjzcnyDZ+wneYBJr+sPY=; b=SFphwxHvauUd6O3d2eu9FLO2vQ5kduFrcpvqGGzdPCmrwP2NWYe3WkoIvWSz4kgNX8 b0BMTaiEn+rjno1gEEjiskAwvv22dFfLOt0T1bL6VShKOciqtXsvdLy0ptWdQ9k9/cOF kiEwlZNxEoLWc3MiP2+H0wu3q5l0AlC83mmLcuthv4rPSrrpOZFeOXPeF5CB3YgzxdAU x5NRMJSva8lCl3TQ9eS9qMxtnbRurrwvGcb7BABCByY5XoyxrKb6eXqzL+VqteOBRJIv aDObPtJiuGXvP9ep2nG4XNeGj7UtPkGO5bfo7AUY9265mmh/S/dzfi9Eoa+CNcloaUp1 vpcg==
X-Gm-Message-State: AOAM530fgjeH7IzhGgH3ypkiv/6p1XUIDfE0AhVKW6tg2krbi4sZYZJH y/OTwc93tHBMtBiOqfY4jz1o44RWsOOAERoDedygnaD+bbA=
X-Google-Smtp-Source: ABdhPJx2WbSerl0WkKzZOKfErRgw8jVWtHtyBQDOMF1vZaU3Nm24PctsgNEPwhfTfjswY83tBeItgKC/la3IOxsyLJk=
X-Received: by 2002:a17:906:7da:: with SMTP id m26mr10450242ejc.342.1589305169907; Tue, 12 May 2020 10:39:29 -0700 (PDT)
MIME-Version: 1.0
References: <f55521dd-e1d3-d925-688c-c472ad67bfb4@gmx.de> <20200512172347.GB4817@1wt.eu>
In-Reply-To: <20200512172347.GB4817@1wt.eu>
From: Ian Clelland <iclelland@google.com>
Date: Tue, 12 May 2020 13:39:18 -0400
Message-ID: <CAK_TSXJ3o7F9x63MSYyEhr7de0vO1Yu2s8JnjkhT7n4BQiQp+A@mail.gmail.com>
To: Willy Tarreau <w@1wt.eu>
Cc: Julian Reschke <julian.reschke@gmx.de>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="000000000000182da105a576f276"
Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=iclelland@google.com; helo=mail-ej1-x634.google.com
X-W3C-Hub-Spam-Status: No, score=-21.6
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1jYYsY-0006Gp-M7 211df9e7162942107fda9ac1f3fbbc21
X-Original-To: ietf-http-wg@w3.org
Subject: Re: draft-ietf-httpbis-header-structure: handling multiple field values
Archived-At: <https://www.w3.org/mid/CAK_TSXJ3o7F9x63MSYyEhr7de0vO1Yu2s8JnjkhT7n4BQiQp+A@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/37602
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: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

This is mentioned in
https://httpwg.org/http-extensions/draft-ietf-httpbis-header-structure.html#rfc.section.4.2
--
"parsers MUST combine all lines in the same section (header or trailer)
that case-insensitively match the field name into one comma-separated
field-value", (with the warning given that strings split across multiple
field values will have "unpredictable results") -- So I don't think you're
allowed to parse them separately. If both exist in the same message, they
must be combined before parsing.

On Tue, May 12, 2020 at 1:27 PM Willy Tarreau <w@1wt.eu> wrote:

> Hi Julian,
>
> On Tue, May 12, 2020 at 06:53:40PM +0200, Julian Reschke wrote:
> > Hi there,
> >
> > while working on an implementation I encountered the following question.
> >
> > Consider something defined as "sh-list". If a value is received spread
> > over multiple field instances, recipients *can* recombine the value
> > before processing. So for
> >
> >   Foo: "1
> >   Foo: 2"
> >
> > ...the parser would see the string "1,2" (or maybe "1, 2").
> >
> > What's not totally clear to me is whether recipients are *allowed* to
> > process the field values separately, in which case parsing would fail.
>
> Note that they might not be aware that these were two values
> because the folding might have been performed by an upstream
> gateway.
>
> Regards,
> Willy
>
>