Re: JSON headers

Cory Benfield <cory@lukasa.co.uk> Sat, 09 July 2016 16:27 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 2E71212D563 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 9 Jul 2016 09:27:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.347
X-Spam-Level:
X-Spam-Status: No, score=-8.347 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426, SPF_HELO_PASS=-0.001, SPF_PASS=-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 aiwN82b7MT2J for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 9 Jul 2016 09:27:50 -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 0A7B612D526 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sat, 9 Jul 2016 09:27:49 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bLv2V-0007ZB-EC for ietf-http-wg-dist@listhub.w3.org; Sat, 09 Jul 2016 16:23:35 +0000
Resent-Date: Sat, 09 Jul 2016 16:23:35 +0000
Resent-Message-Id: <E1bLv2V-0007ZB-EC@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 <cory@lukasa.co.uk>) id 1bLv2S-0007YP-HP for ietf-http-wg@listhub.w3.org; Sat, 09 Jul 2016 16:23:32 +0000
Received: from mail-wm0-f46.google.com ([74.125.82.46]) by maggie.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <cory@lukasa.co.uk>) id 1bLv2P-0001ya-VQ for ietf-http-wg@w3.org; Sat, 09 Jul 2016 16:23:31 +0000
Received: by mail-wm0-f46.google.com with SMTP id k123so44845716wme.0 for <ietf-http-wg@w3.org>; Sat, 09 Jul 2016 09:23:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lukasa-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=WAoNmBYX1mtpl0xk34APfV7u8Z+bQ8GWJjziC5aHIWM=; b=hfeAdxR7fijTpw62k+K5SlKhhNzb37mhq88LEMAksvRsiz4w4aDQtyHH/8MaFfK0IS 2qx2/HuyLgh6nM299WstNKkzs6VuG/hTHCOQb97yLirfqJ64fx1ANFCd/HFB5CdIfLAN SscUw9BvKOcBc0vQkHqTaPJ6aw0hPzV7oFSmlhdvpDXYgzivglvKjzI1Sk3f4AeD+hue xq8xCMcq7Ko3j7CdtbdDTuaSnWlBSESY2oNvU/feKsFc2p1djnkmdsx5AnTi6JI66G7S tIlHIe7l2NCeGop27xadJpA9y8XbrEKbe9sYeqiQxSj4EEmS6yBt6YrdXpR7E+oAlkz0 s91A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=WAoNmBYX1mtpl0xk34APfV7u8Z+bQ8GWJjziC5aHIWM=; b=ZodMb6/F9SNkYwR7uUCxeh6Hmps4NwsgBYXsQXBCPQ20GBup8fnYeODpbGX/jlrzTy qz3zpMmmZKgQdC+/2PX1X5Ct/ooABd8Hq0jgIKsnN6o7N5YPKQv5GtCXJEqw7w5JMLLR hQfZJbk4mz0rg9mbQ653Ny6wbkFXSZTaMHRQDrMEz1ondm7bB6BOjxbF0HKgf1eISkgR xlaOBIgxvhONeJKGPx39J93fXM2zam6xgMD10UtJ5e3ETXNYjArc7ysxBvoelmvt+GHp ihDSdzRsWIccle2/lXdUlP8UQwE9fiveLfW4c0TxzSWUSaciRePuHB37wAl1gxKt4WX6 dxmg==
X-Gm-Message-State: ALyK8tIPsD7JibtIV+fKLIULgdM7c71a9UOw6/fc/FoHMMl57ytAL3FvbUjmQDoGNCf6AA==
X-Received: by 10.28.66.204 with SMTP id k73mr3572974wmi.20.1468081382684; Sat, 09 Jul 2016 09:23:02 -0700 (PDT)
Received: from [192.168.1.5] (134.64.6.51.dyn.plus.net. [51.6.64.134]) by smtp.gmail.com with ESMTPSA id e69sm8622690wma.2.2016.07.09.09.23.01 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 09 Jul 2016 09:23:01 -0700 (PDT)
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Content-Type: multipart/signed; boundary="Apple-Mail=_4617B0C0-5686-4EFB-9D99-F66F519665D3"; protocol="application/pgp-signature"; micalg="pgp-sha256"
X-Pgp-Agent: GPGMail
From: Cory Benfield <cory@lukasa.co.uk>
In-Reply-To: <74180.1468000149@critter.freebsd.dk>
Date: Sat, 09 Jul 2016 17:22:59 +0100
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Message-Id: <F72E21BA-E891-4E1B-8535-385616431390@lukasa.co.uk>
References: <74180.1468000149@critter.freebsd.dk>
To: Poul-Henning Kamp <phk@phk.freebsd.dk>
X-Mailer: Apple Mail (2.3124)
Received-SPF: pass client-ip=74.125.82.46; envelope-from=cory@lukasa.co.uk; helo=mail-wm0-f46.google.com
X-W3C-Hub-Spam-Status: No, score=-4.6
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: maggie.w3.org 1bLv2P-0001ya-VQ 763aba31570b8a30bf51ce31b9700012
X-Original-To: ietf-http-wg@w3.org
Subject: Re: JSON headers
Archived-At: <http://www.w3.org/mid/F72E21BA-E891-4E1B-8535-385616431390@lukasa.co.uk>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/31848
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>

> On 8 Jul 2016, at 18:49, Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:

Before I go any further, let me agree with Mike about this: I am generally 100% on the “structured serialisation format for header values” approach being discussed. I definitely want to see something in this space.

> Now lets go one step further:  Most implementations today support
> gzip, so the above should be the default if no Accept-Encoding
> header is present.  If you do not support gzip, you'll have to
> send:
> 
> 	Accept-Encoding: [ ]
> 
> Everybody else can avoid sending Accept-Encoding entirely.

This is one of those interesting decisions that has a tendency to make life very tricky for implementation authors. Generally speaking it is unwise to have the “do nothing” behaviour be totally wrong: that’s arguably what this would do. Specifically, if you write a HTTP implementation and don’t know anything about the Content-Encoding header, in the current model you shouldn’t be served anything weird. Basically, you’ll get data you recognise and expect. You need to opt-in to the compression. That means that RFC-compliant servers, written to expect that gzip will work in the absence of an Accept-Encoding header saying otherwise, will break naively-written clients that never considered Accept-Encoding.

I’m not sure this is a compelling reason *not* to do this. After all, this is not the only such behaviour that cannot be opted-into (see also chunked transfer encoding). It’s just a data point worth considering.

(I should also note that it’s weird that all Accept-Encoding header lists are implicitly terminated with “identity”, but the absence of such a header translates into “gzip”. That’s a strange inconsistency and I guarantee it’ll trip people up. It’s only an inconsistency though, and your rationale for it is well-reasoned.)

Cory