Re: H2 vs responses which should not carry any payload

Greg Wilkins <gregw@webtide.com> Sun, 25 October 2020 15:13 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 7345E3A0A2D for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 25 Oct 2020 08:13:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.647
X-Spam-Level:
X-Spam-Status: No, score=-2.647 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-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] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=webtide-com.20150623.gappssmtp.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 nrO3KVzZCpKx for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 25 Oct 2020 08:13:06 -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 525A23A0A2B for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sun, 25 Oct 2020 08:13:05 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1kWhed-0005kY-1y for ietf-http-wg-dist@listhub.w3.org; Sun, 25 Oct 2020 15:09:55 +0000
Resent-Date: Sun, 25 Oct 2020 15:09:55 +0000
Resent-Message-Id: <E1kWhed-0005kY-1y@lyra.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by lyra.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <gregw@webtide.com>) id 1kWheb-0005jh-IN for ietf-http-wg@listhub.w3.org; Sun, 25 Oct 2020 15:09:53 +0000
Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by titan.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <gregw@webtide.com>) id 1kWheZ-0000i3-AT for ietf-http-wg@w3.org; Sun, 25 Oct 2020 15:09:53 +0000
Received: by mail-oi1-x22a.google.com with SMTP id 16so7935446oix.9 for <ietf-http-wg@w3.org>; Sun, 25 Oct 2020 08:09:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=webtide-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yAJeGL/1yreaxkZmvDISnDfes9bp+vkKpoEx8mEBgHw=; b=kdDeeNnqlXCrqPMhFynISF8DoEpny0h8/Ne30v9Cvh0qq9rfou2IexsV02nxiko07N ca9oWrbLe0FvYUw942nf1iuGrMyCd/vvAAKX/bD/bOfob3ee6JMHKuKnsL9xpiNEdMN5 I2MtGlsJc0PMvEsqlrKt0GMfW3gAqV1ty8s+i3uXDmj8jT+YzDTKsf2JlN7MYqb4ziL4 tcwbLVBWv5Jt7dR4QSUhfssUr9LNR41hJdgWDPl694xIIAl1shVeVa0Cuvbd47tnjNJf 7YTJwlDk/e9a9+B4K5391QLjKiaTQG6um0WDowm2o/qWtCpzSlqZ5VQkkLzHCn+3tnSX dEUw==
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=yAJeGL/1yreaxkZmvDISnDfes9bp+vkKpoEx8mEBgHw=; b=gHqnBTFgt6mXylvoADK5N4fJK9iwcpA3SRuFePmlqW9uSu5EsATaA5xVf2LAOStuLr rfGdlugpyeWo1JXKYNQJKa9Vl9tzaW/ln6IEBQZcbxd1tpGiuWMwZWRzoR8lmBOenpEb DXH39e/sGzStgz9CUO2OryPREtvTXvtijr3IDfr0Q97drjh6WlzdarX5ePPW9BCl+wVe KcTV2aABo7HDtz089QQBByD/KqG069HWPuttAqFrDVBF4c72Jo/8ONU8+oRTtpHBvwc4 UQfWxfLVnAQL8pcdzOqdoZYVPQQty6FxJCnHIhTJD9sc21K+C2hfzDsBxe8RsgFBcw1b MFaw==
X-Gm-Message-State: AOAM531OboyKzEHZOVdNvNqtzpBYnLjsjM+F94GES2h0QxskRj5J5rBZ QNHxv8ZwQnlE+2lrqaxXFLBWt3WzlFrb9/ko7tCk6YMO3LtOntau
X-Google-Smtp-Source: ABdhPJy4W+WXbsFKZLqNhKU7Cak7psIsREJaPEYbYGbk+r/tHIy6/eV9xsH0NQfgtvMz60JW19LThoGGaNiMolftEPI=
X-Received: by 2002:aca:d941:: with SMTP id q62mr10428179oig.33.1603638580156; Sun, 25 Oct 2020 08:09:40 -0700 (PDT)
MIME-Version: 1.0
References: <20201023045426.GB4941@1wt.eu>
In-Reply-To: <20201023045426.GB4941@1wt.eu>
From: Greg Wilkins <gregw@webtide.com>
Date: Sun, 25 Oct 2020 16:09:29 +0100
Message-ID: <CAAPGdfHKLOgtr2t1wfVq7QuFL+wyUPQOT2A+9w1cbp7gi67r3g@mail.gmail.com>
To: Willy Tarreau <w@1wt.eu>
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="000000000000eb2d5c05b2803352"
Received-SPF: pass client-ip=2607:f8b0:4864:20::22a; envelope-from=gregw@webtide.com; helo=mail-oi1-x22a.google.com
X-W3C-Hub-Spam-Status: No, score=-3.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1kWheZ-0000i3-AT bb4155065bee59b88552cddbfbd6bfde
X-Original-To: ietf-http-wg@w3.org
Subject: Re: H2 vs responses which should not carry any payload
Archived-At: <https://www.w3.org/mid/CAAPGdfHKLOgtr2t1wfVq7QuFL+wyUPQOT2A+9w1cbp7gi67r3g@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/38118
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>

Willy,

You describe having a semantic layer that can have H1 or H2 either side.
So let's consider the case of H1->Poxy->H2.  In this case if the server
gives you a body to a 204/304 response or a HEAD request, then you have no
way of passing them back to the client  - as it breaks H1.  You must filter
them in that case in your semantic layer, thus it would make sense to me to
also filter them in the H2->Proxy>H2 case.

cheers


On Fri, 23 Oct 2020 at 06:57, Willy Tarreau <w@1wt.eu> wrote:

> Hi all,
>
> we've recently faced a stupid case in haproxy with H2 and I realized that
> I didn't find the good response in the spec.
>
> What we've seen is that a client sends a HEAD request, which we forward
> to the server. In response the server returns an error with some payload
> (possibly a typical pre-made error page that doesn't care about the
> method),
> and haproxy forwards both the HEADERS and DATA frames to the client, then
> the client complains about protocol violations (I don't know yet what the
> client is for now but I don't think it's important).
>
> We were wondering where we ought to trim the payload in this case (and
> for 204/304 as well), whether we ought to do this while reading the
> response from the server or when sending the response do the client, and I
> figured that nowhere at all in 7540 is mentioned anything about
> 204/304/HEAD
> and that made me start to wonder if adjusting this at the H2 level is the
> right solution, and if we ought to do anything about it or not (since
> after all maybe everyone is right in this whole chain).
>
> We all know that 204/304/HEAD are between transport and semantics because
> for H1 these directly affect the parsing. From this perspective it would
> make
> sense to consider that H2 should drop these. But if we consider semantics
> only, it also makes sense to consider that H2 should let everything pass
> through.
>
> And even then, do all implementations accept, say, a HEADERS frame with
> no ES flag in response to a HEAD request, followed by an empty DATA frame
> carrying the ES flag ? At the semantic level it's OK since there's no
> payload, but I can understand how some could find it annoying to wait
> for DATA frames when no payload is expected (it's our case as well as
> part of the possible fixes for this).
>
> For those who want a bit more details, internally we're not directly
> forwarding frames but transcoding these into a version-agnostic HTTP
> representation that allows us to have either H1 or H2 on any side. This
> internal version carries the semantics. If we decide that H2 has nothing
> to do with this, we can decide to perform the filtering at the semantics
> layer, while knowing that when it comes to H1 it still has to take these
> special cases for the messaging anyway. It even makes me suspect that
> the contraints are double, in that HEAD/204/304 ought to see no response
> payload at the semantic layer, and that H1 is a special case in that it
> cannot accept that either at the transport layer to respect the messaging
> and that it's not a problem if it duplicates that check.
>
> I'm interested in any opinion on this subject (or any pointers to anything
> I could have missed).
>
> Thanks!
> Willy
>
>

-- 
Greg Wilkins <gregw@webtide.com> CTO http://webtide.com