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

"Poul-Henning Kamp" <phk@phk.freebsd.dk> Sat, 15 October 2016 09:45 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 787D712968D for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 15 Oct 2016 02:45:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.897
X-Spam-Level:
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 mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 74dew9EwXkiq for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 15 Oct 2016 02:45:36 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7F34212963D for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sat, 15 Oct 2016 02:45:36 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bvLTF-0002oX-EP for ietf-http-wg-dist@listhub.w3.org; Sat, 15 Oct 2016 09:41:37 +0000
Resent-Date: Sat, 15 Oct 2016 09:41:37 +0000
Resent-Message-Id: <E1bvLTF-0002oX-EP@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <phk@phk.freebsd.dk>) id 1bvLTB-0002ni-8q for ietf-http-wg@listhub.w3.org; Sat, 15 Oct 2016 09:41:33 +0000
Received: from phk.freebsd.dk ([130.225.244.222]) by maggie.w3.org with esmtp (Exim 4.80) (envelope-from <phk@phk.freebsd.dk>) id 1bvLT9-0003hf-9h for ietf-http-wg@w3.org; Sat, 15 Oct 2016 09:41:32 +0000
Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 666A0273ED; Sat, 15 Oct 2016 09:41:08 +0000 (UTC)
Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTP id u9F9f7hw078302; Sat, 15 Oct 2016 09:41:07 GMT (envelope-from phk@phk.freebsd.dk)
To: Matt Menke <mmenke@google.com>, ietf-http-wg@w3.org
In-reply-to: <CAEK7mvoXqyX3cADJytjU+C158EULgPLbzAb5kiUN=8WWxhi29Q@mail.gmail.com>
From: Poul-Henning Kamp <phk@phk.freebsd.dk>
References: <CAEK7mvoXqyX3cADJytjU+C158EULgPLbzAb5kiUN=8WWxhi29Q@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <78300.1476524467.1@critter.freebsd.dk>
Content-Transfer-Encoding: quoted-printable
Date: Sat, 15 Oct 2016 09:41:07 +0000
Message-ID: <78301.1476524467@critter.freebsd.dk>
Received-SPF: none client-ip=130.225.244.222; envelope-from=phk@phk.freebsd.dk; helo=phk.freebsd.dk
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: maggie.w3.org 1bvLT9-0003hf-9h eb898bd55eaad3c1eb5cc39d1432a71c
X-Original-To: ietf-http-wg@w3.org
Subject: Re: draft-ietf-httpbis-jfv: what's next
Archived-At: <http://www.w3.org/mid/78301.1476524467@critter.freebsd.dk>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/32599
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>

--------
In message <CAEK7mvoXqyX3cADJytjU+C158EULgPLbzAb5kiUN=8WWxhi29Q@mail.gmail.com>
, 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.