Re: Transfer-Encoding chunked: preserved in the wild?

Cory Benfield <cory@lukasa.co.uk> Mon, 25 January 2021 11:51 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 A71A43A1007 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 25 Jan 2021 03:51:05 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.771
X-Spam-Level:
X-Spam-Status: No, score=-0.771 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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=lukasa-co-uk.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 D-OjI4lL9zmI for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 25 Jan 2021 03:51:03 -0800 (PST)
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 6AA373A0FF0 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 25 Jan 2021 03:50:45 -0800 (PST)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1l40Ln-0005qt-KT for ietf-http-wg-dist@listhub.w3.org; Mon, 25 Jan 2021 11:48:07 +0000
Resent-Date: Mon, 25 Jan 2021 11:48:07 +0000
Resent-Message-Id: <E1l40Ln-0005qt-KT@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 <cory@lukasa.co.uk>) id 1l40Ll-0005mv-Ix for ietf-http-wg@listhub.w3.org; Mon, 25 Jan 2021 11:48:05 +0000
Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by titan.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <cory@lukasa.co.uk>) id 1l40Lj-0002EB-4F for ietf-http-wg@w3.org; Mon, 25 Jan 2021 11:48:05 +0000
Received: by mail-lf1-x130.google.com with SMTP id b26so17232145lff.9 for <ietf-http-wg@w3.org>; Mon, 25 Jan 2021 03:48:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lukasa-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=7bEMvvJ1SWTnZY93UMofiabO4zloKeuTl4n6LPjaBuE=; b=HoFng8vPxSltDXTOVcznKHHTfMFScxjTC44V8VjEjsDTsvJzvInBSFYVlKGa+V8vy0 pMGtQYZ++jbo6Bavwo9FgOsW7QnTJf2S976n31BppazHIwwJ1GuYIC5+JP4d++VfHHmg h+atiLCnAG8Rvs/5nXhdRLf30IskZ1xIaEWdYzHdvmJ71f397/MVPIQ1KmgDjUBhLrTf LRXObQQFeSDpVDYyXTZ5S2m0slR0cOEZCh7O+K3x8gOwgum4a+Xm/jNpEaBWYvWx6orY AVPOy1gNoM5Zp8o1kUKHDSAx4p9FVBuE34kKKClv17NinU+b85k8EmXg/RWiP35x+KUG F1Hg==
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:content-transfer-encoding; bh=7bEMvvJ1SWTnZY93UMofiabO4zloKeuTl4n6LPjaBuE=; b=JqgGEiRfTQGNj+F2A5aVCFNCq8IARNxZrAJ6qbhZOkqYqlfY463N/ahBjyFPIak2bT l7dDp1EZEc4VrxIUjeJgs3ccv10wt6MwFviwL2RB9SlY4lXHwkMJJLsY6YWH49hywi3l aKUthFQC1DTjyXjhHsGZamplBlWDtA7Y34Jx8pou9Vv5oW3IETrHuIpwwY3fsrCYOFi/ R337N4L0mLi8EQyXI5RPx++fCG8FcNkEprt6PkZyc1m71XLDLbvwXzRUlBanUsSONrcL kKv1FmibDK59XxFOp4U3CEzEyKVLPi8WMZnlPISZc+cxZS8JrVQaPoR4UqpyF//W7HzI ReUw==
X-Gm-Message-State: AOAM531H9ssbZYZ5IRN6jVl10fKE4JLr21VOxnaPUpQIHwdGwNLtYD7y 8g544wY/nj3lCZMoqVFc/nFeXqxMZpnXnCHDUAHlxs9RRsLTDQ==
X-Google-Smtp-Source: ABdhPJy6SKBUs4FOadl4R0Sq6Y/Lph4dXzfQTlaFDOUMKByaFi+6jzoOSvjxBZRre8rG588+VdrJpHy+rhZNI0bCCLk=
X-Received: by 2002:ac2:4855:: with SMTP id 21mr104256lfy.284.1611575270370; Mon, 25 Jan 2021 03:47:50 -0800 (PST)
MIME-Version: 1.0
References: <b27f7ecd-348c-4ea7-941c-f3151476934c@www.fastmail.com>
In-Reply-To: <b27f7ecd-348c-4ea7-941c-f3151476934c@www.fastmail.com>
From: Cory Benfield <cory@lukasa.co.uk>
Date: Mon, 25 Jan 2021 11:47:39 +0000
Message-ID: <CAH_hAJGhuaBzut69M8-+oFfb7wpwh9-Wgfx5SRxGMpsTnZB97g@mail.gmail.com>
To: Seph Gentle <me@josephg.com>
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=cory@lukasa.co.uk; helo=mail-lf1-x130.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, 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 1l40Lj-0002EB-4F 8ac9739624ee4ddbe295bed986ccd3dc
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Transfer-Encoding chunked: preserved in the wild?
Archived-At: <https://www.w3.org/mid/CAH_hAJGhuaBzut69M8-+oFfb7wpwh9-Wgfx5SRxGMpsTnZB97g@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/38392
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>

I'll echo the concerns of the group, and add that the HTTP
specifications explicitly call out that this usage is not
interoperable. Citing the upcoming HTTP/1.1 message syntax draft § 6.1
Transfer Encoding
(https://www.ietf.org/archive/id/draft-ietf-httpbis-messaging-14.html#name-transfer-encoding):

>  Unlike Content-Encoding (Section 8.4.1 of [Semantics]), Transfer-
>  Encoding is a property of the message, not of the representation, and
>  any recipient along the request/response chain MAY decode the
>  received transfer coding(s) or apply additional transfer coding(s) to
>  the message body, assuming that corresponding changes are made to the
>  Transfer-Encoding field value.

In this case, I'd recommend just adding your own framing. The chunked
transfer encoding framing is essentially trivial (regular old
length-prefixed-framing plus some newlines for extra flavour), and
easily replicated within your message body if you're motivated to do
so.

On Mon, 25 Jan 2021 at 10:06, Seph Gentle <me@josephg.com> wrote:
>
> Hi everyone!
>
> I’m working with Mike and others to figure out & clean up the protocol for braid. We want to add real-time subscriptions to http.
>
> For this we need to send a stream of messages (values and patches) in response to a single http request. The simplest way to encode that would be to lean on transfer-encoding: chunked and wrap each patch in exactly one http “chunk”, so we don’t need to do our own message framing.
>
> I want to lean on some collective wisdom here. Is this a bad idea? Does anyone know if middleman proxy servers ever move chunk boundaries around? Is that valid according to the protocol? Is that something we should worry about?
>
> (Server sent events do their own message framing on top of the transfer encoding. Is there a good reason for that?).
>
> -Seph
>
>