Re: Revising Structured Fields: scope

Willy Tarreau <w@1wt.eu> Thu, 13 October 2022 06:34 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 7A7D8C1524D9 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 12 Oct 2022 23:34:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.662
X-Spam-Level:
X-Spam-Status: No, score=-7.662 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LZZB29inqivV for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 12 Oct 2022 23:34:53 -0700 (PDT)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5543DC14CF1D for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 12 Oct 2022 23:34:52 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.94.2) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1oirl8-003ViR-8c for ietf-http-wg-dist@listhub.w3.org; Thu, 13 Oct 2022 06:31:58 +0000
Resent-Date: Thu, 13 Oct 2022 06:31:58 +0000
Resent-Message-Id: <E1oirl8-003ViR-8c@lyra.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) by lyra.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <w@1wt.eu>) id 1oirl6-003Vh0-My for ietf-http-wg@listhub.w3.org; Thu, 13 Oct 2022 06:31:56 +0000
Received: from wtarreau.pck.nerim.net ([62.212.114.60] helo=1wt.eu) by mimas.w3.org with esmtp (Exim 4.94.2) (envelope-from <w@1wt.eu>) id 1oirl4-00C3xV-Uu for ietf-http-wg@w3.org; Thu, 13 Oct 2022 06:31:56 +0000
Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 29D6VctI016514; Thu, 13 Oct 2022 08:31:38 +0200
Date: Thu, 13 Oct 2022 08:31:38 +0200
From: Willy Tarreau <w@1wt.eu>
To: Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc: Mark Nottingham <mnot@mnot.net>, HTTP Working Group <ietf-http-wg@w3.org>
Message-ID: <20221013063138.GB16429@1wt.eu>
References: <37AA7568-86A9-4543-845F-EA2DAAA946B1@mnot.net> <20221013023941.GA15353@1wt.eu> <202210130542.29D5gbaI092977@critter.freebsd.dk>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <202210130542.29D5gbaI092977@critter.freebsd.dk>
User-Agent: Mutt/1.10.1 (2018-07-13)
Received-SPF: pass client-ip=62.212.114.60; envelope-from=w@1wt.eu; helo=1wt.eu
X-W3C-Hub-Spam-Status: No, score=-4.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1oirl4-00C3xV-Uu a7d038af70dddad70103baa656e2c995
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Revising Structured Fields: scope
Archived-At: <https://www.w3.org/mid/20221013063138.GB16429@1wt.eu>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/40443
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>

On Thu, Oct 13, 2022 at 05:42:37AM +0000, Poul-Henning Kamp wrote:
> --------
> Willy Tarreau writes:
> 
> > I would really
> > like it if we would remove that limitation so that we could hope to more
> > easily retrofit other fields there, and it doesn't seem like too complicated
> > change to me to simply add "sf-empty" to the bare-item definition, which
> > would likely solve this.
> 
> I fear that codifying that would encourage more headers with
> such behaviour, which I assume we do not want ?

I don't think it would encourage this because I don't think the rare header
fields that need this nowadays predicted this use, it was just the result
of an overlooked corner case that later left only this option (i.e. reject
a request if the field is absent, or have a default value if not set). I'm
not aware of a single field that was deliberately designed as having an
empty value as something intentional. And it would be annoying if in the
future some fields designed to fit into the SF representation start to
appear as empty because of a similar corner case and suddenly the SF
parsers fail on them while non-SF ones are fine with that. And that's
precisely what currently refrains me from implementing SF: breaking
interoperability where alternate solutions would be fine.

> I would far prefer to let the very few headers which has this behaviour
> be special-cased in their own definition.

It may extend to one new field every 10 years just because someone
decided that the field is mandatory, while the sender has no idea about
what to put into it. That's precisely what I want to secure for the long
term.

> If I am wrong about that, and if you mean something like adding in 4.1:
> 
> 	0.   If the structure value is sf-empty, return an empty string.
> 
> and in 4.2:
> 
> 	1a.  If sf-empty is a permissible field value and input_string
> 	     consists entirely of SP characters, return sf-empty.
> 
> That seems mostly harmless to me.

That would be fine for me. The second point could even be simplified to:

  2a. If sf-empty is a permissible field value and input_string has no
      remaining characters, return sf-empty.

> If you want sf-empty anywhere else, I am a firm NO, because it would
> require significant work to redefine inner_list and maybe other places.

I agree. The only valid reason for an empty header field is to distinguish
it from an absence which would carry a different semantic. So there's no
reason to have an empty list item for example, as it would be equivalent
to a first non-empty one and a second empty one. And for headers folding
into lists, we could require that empty ones are just skipped in presence
of at least a non-empty one, and that's already mandated by 9110#5.6.1
which forbids production of empty list elements by the way, so we should
be fine.

Thanks!
Willy