Re: draft-ietf-httpbis-jfv: what's next

"Poul-Henning Kamp" <> Sat, 15 October 2016 09:45 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 787D712968D for <>; Sat, 15 Oct 2016 02:45:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -9.897
X-Spam-Status: No, score=-9.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-2.996, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 74dew9EwXkiq for <>; Sat, 15 Oct 2016 02:45:36 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 7F34212963D for <>; Sat, 15 Oct 2016 02:45:36 -0700 (PDT)
Received: from lists by with local (Exim 4.80) (envelope-from <>) id 1bvLTF-0002oX-EP for; Sat, 15 Oct 2016 09:41:37 +0000
Resent-Date: Sat, 15 Oct 2016 09:41:37 +0000
Resent-Message-Id: <>
Received: from ([]) by with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <>) id 1bvLTB-0002ni-8q for; Sat, 15 Oct 2016 09:41:33 +0000
Received: from ([]) by with esmtp (Exim 4.80) (envelope-from <>) id 1bvLT9-0003hf-9h for; Sat, 15 Oct 2016 09:41:32 +0000
Received: from (unknown []) by (Postfix) with ESMTP id 666A0273ED; Sat, 15 Oct 2016 09:41:08 +0000 (UTC)
Received: from (localhost []) by (8.15.2/8.15.2) with ESMTP id u9F9f7hw078302; Sat, 15 Oct 2016 09:41:07 GMT (envelope-from
To: Matt Menke <>,
In-reply-to: <>
From: Poul-Henning Kamp <>
References: <>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <>
Content-Transfer-Encoding: quoted-printable
Date: Sat, 15 Oct 2016 09:41:07 +0000
Message-ID: <>
Received-SPF: none client-ip=;;
X-W3C-Hub-Spam-Status: No, score=-5.6
X-W3C-Hub-Spam-Report: AWL=-1.231, BAYES_00=-1.9, RP_MATCHES_RCVD=-0.425, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: 1bvLT9-0003hf-9h eb898bd55eaad3c1eb5cc39d1432a71c
Subject: Re: draft-ietf-httpbis-jfv: what's next
Archived-At: <>
X-Mailing-List: <> archive/latest/32599
Precedence: list
List-Id: <>
List-Help: <>
List-Post: <>
List-Unsubscribe: <>

In message <>
, Matt Menke writes:
>I think the draft looks good, but have a couple comments:
>The token rule in RFC7230 already includes asterisks, so I don't think =
>identifier or token_or_asterix is needed.

Yes, I just fixed that.

>Would it make sense to codify behavior if a part of a 
>h1_common_structure value fails to parse, at least if it uses the 
>proposed "><" format)?  I suspect what browsers do is inconsistent here, 
>and having some official rule (ignore the entire element vs ignore the 
>entire line vs ignore the broken parameter) seems like it would be worth 
>having?  I'd go with throw away the entire header line, if it uses the 
>new format and that happens, since that's easiest to standardize on.

So this is a bit of a sticky wicket.

Today that is a per-header decision, for instance Accept-Encoding
can safely ignore anything it doesn't understand/parse, whereas
Content-Encoding has to be parsed perfect.

It is also a soft spot which has been used in a number of creative
attacks on deeper layer in HTTP/1 sandwiches.

Looking forward, if we want to be able to use CS to build H3
compression, we cannot allow CS headers with format errors.

I'm uncomfortable with a rule which says "just ignore", so I would
propose that failure to parse a the CS level should cause a 4xx
error, just like an ascii BEL in a HTTP1 header would.

But please note that this is only at the CS level, how valid CS
which is semantically invalid (ie: "Content-Length: ABCD") should
be handled is outside the scope of this ID.  I'm not even sure
we can give a meaningful "default" rule.

>I think it's unfortunate that the HTTP/1 serialization can't distinguish 
>between identifiers, numbers, and timestamps.

Yes, but we don't really get to decide where we start.

My hope is that we can build a machine-readable specification language
for HTTP headers from which the "semantic parsing" code can be generated,
but that is clearly in the "future work" column.

>It means that 
>per-specific-header logic will have to be responsible for that extra 
>round of parsing for HTTP/1 headers.

Not necessarily.  Parsing CS in HTTP/1 serialization is very trivial
and it is not obvious to me that it always would or should be a
separate step.  With a specification language as mentioned above,
you probably would generate combined CS+semantic parser code.

The big advantage of CS is that we don't need to know the semantics.

If your implementation receives "My-Private-Header: >[...]<" it can
take it apart and present it as a native datastructure, and the
application logic can apply the privatly known semantics to that.

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.