Re: JSON headers

Yanick Rochon <yanick.rochon@gmail.com> Sun, 10 July 2016 12:09 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 0B92712D140 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 10 Jul 2016 05:09:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.307
X-Spam-Level:
X-Spam-Status: No, score=-8.307 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.287, 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=gmail.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 8vD2p7eudyyQ for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 10 Jul 2016 05:09:19 -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 B6B7612B078 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sun, 10 Jul 2016 05:09:19 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bMDTX-00088e-J0 for ietf-http-wg-dist@listhub.w3.org; Sun, 10 Jul 2016 12:04:43 +0000
Resent-Date: Sun, 10 Jul 2016 12:04:43 +0000
Resent-Message-Id: <E1bMDTX-00088e-J0@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <yanick.rochon@gmail.com>) id 1bMDTT-00087s-Bu for ietf-http-wg@listhub.w3.org; Sun, 10 Jul 2016 12:04:39 +0000
Received: from mail-vk0-f52.google.com ([209.85.213.52]) by lisa.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <yanick.rochon@gmail.com>) id 1bMDTR-0004b4-BU for ietf-http-wg@w3.org; Sun, 10 Jul 2016 12:04:38 +0000
Received: by mail-vk0-f52.google.com with SMTP id v6so107071318vkb.2 for <ietf-http-wg@w3.org>; Sun, 10 Jul 2016 05:04:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=O8f2oJ58QUBcBiePSCWL1XN+hVYjyhU8fcJAil5VIbs=; b=Ii8CbFFn2ktk9mH0bm3yWmlRGenY1Guj1yh9Ku27gwzXevJyNhQljajEka6zbLJDVr C8nFCe/MQNgdAF6b/q/0JGPgjikKUp2T++ovOEDdvZT2zuwHmGo+26BUWBWb+PlVaLIJ kTAN87vUnYA6Hy4eb4QPe4FDCxOU6O2BMisjQiHPSup1et3FFdRYEaerJe89Ww0eOUtU 9ve6VEQdMklvYX9YFjgg7wDdH+PLSee8lXykhKFgmYr/s4UeAvDQ5if0WJP8KSr+gBjz hzInbj6egcmG9XCD/gwLFp9jQ2ZuT21YeYrSVNwzc/BvKOSK61mz+8KLxayPgt4bqfQi ChLg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=O8f2oJ58QUBcBiePSCWL1XN+hVYjyhU8fcJAil5VIbs=; b=Ra7lK6tUE00W+eK9rYfMYz58870HcPOBP6Soufd1NTaMzWnjqQX8E1J38AyqfhAyb/ YISGihYvWr1xYwV4+SmuLqzLVTnM3Z0Fm+xoEqJ6QUsWNKKwtPxDdFhqOp0AyEIT3Dka NYnINjAq3wTrTFXbE0+wN3ww5GIfuhCqu80g9DgJl2BBCsfbo4PDr0qzB/KJIPi3qqxo jjR2eFOtb12enjVU5E0GWNe+tw4NkZ+hbzk7K8WUtYDV11NshVFM0yaSlJvfZbwPvmyu jmGGCnWb0JVWpOnpE9QXvr7gwSaiHpqCvtrOQ8FjayHyWLB+LPJWgcSxMOltR9ONdj8m hQPw==
X-Gm-Message-State: ALyK8tKa3OD3o7TkGYjWmj2KrH0x2qBdGSXZAcXH3Mb8uZwLqw6yuvzz7HXRV+0QD4sNN8uUfqgYATu6PHGnrw==
X-Received: by 10.31.236.197 with SMTP id k188mr5768517vkh.138.1468152251246; Sun, 10 Jul 2016 05:04:11 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.103.105.75 with HTTP; Sun, 10 Jul 2016 05:03:51 -0700 (PDT)
In-Reply-To: <4324.1468145426@critter.freebsd.dk>
References: <74180.1468000149@critter.freebsd.dk> <A17D3EFD-A935-4971-BCF6-DC9D38302CAD@oracle.com> <564a72e8-b9d3-1f9c-5982-48f2b07272e5@greenbytes.de> <3924.1468137899@critter.freebsd.dk> <683f5f58-6046-d9fb-cc75-d0ab3890ce23@greenbytes.de> <4105.1468141779@critter.freebsd.dk> <5cdf0fa8-063c-7eaa-a9e3-fb6db7417254@gmx.de> <4213.1468143913@critter.freebsd.dk> <94e4a5c2-3465-fef3-6221-d9f4fcccb5fa@gmx.de> <4324.1468145426@critter.freebsd.dk>
From: Yanick Rochon <yanick.rochon@gmail.com>
Date: Sun, 10 Jul 2016 08:03:51 -0400
Message-ID: <CAB0No9kf6gje3Tc+impphV5tUHjksCkL1PJ1YAgNjXO+tLq=XA@mail.gmail.com>
To: Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc: Julian Reschke <julian.reschke@gmx.de>, Phil Hunt <phil.hunt@oracle.com>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="94eb2c0919b269703b053746d5d2"
Received-SPF: pass client-ip=209.85.213.52; envelope-from=yanick.rochon@gmail.com; helo=mail-vk0-f52.google.com
X-W3C-Hub-Spam-Status: No, score=-4.7
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: lisa.w3.org 1bMDTR-0004b4-BU 7d2aebc769ddfe8a21e4fe0b00af5618
X-Original-To: ietf-http-wg@w3.org
Subject: Re: JSON headers
Archived-At: <http://www.w3.org/mid/CAB0No9kf6gje3Tc+impphV5tUHjksCkL1PJ1YAgNjXO+tLq=XA@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/31862
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 10 July 2016 at 06:10, Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:

> --------
> In message <94e4a5c2-3465-fef3-6221-d9f4fcccb5fa@gmx.de>, Julian Reschke
> writes
> :
>
> >But right now the spec *is* written to use the list construct, and I
> >believe that's a good thing, as it's IMHO better to consider multiple
> >instances as legal, and require the definition of the header field to
> >deal with it.
>
> I think it is a bad thing.
>
> It prevents streaming processing of headers, since you never know
> when you have the full picture for a particular header, until you've
> received them all and seen that there are no more instances.
>
> It means also means that either you have to rewrite the headers, or
> all your code needs to do the brute-force collection scan and handle
> an array of headers for further processing.  Both of which is wasteful
> in terms of CPU and memory.
>
> I see no advantages that come even close to compensating for those
> disadvantages, but if I have overlooked something, please enlighten me...
>
>
I agree. Normally, multiple instances are legal in JSON and the latest will
simply override the previous one, but in the case of headers, it is not
good indeed and may produce problem when a repeating header comes after a
few preliminary configurations have been set and will force retrieving the
entire header object instead of the actual implementation (i.e. it would be
a regression, not an improvement). Since streaming headers (feasable in
JSON) is preferrable, duplicated keys in the JSON header should either be
ignored or rejected with an error. It is the responsibility of the sender
to properly format it's header before sending, not the server to untangle a
messy one. In my opinion, repeating headers should be put in an array,
period.