Re: JSON headers

Yanick Rochon <yanick.rochon@gmail.com> Tue, 12 July 2016 04:03 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 05A7412D73A for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 11 Jul 2016 21:03:34 -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 0gf8qDU6AY2q for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 11 Jul 2016 21:03:32 -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 CD195128E19 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 11 Jul 2016 21:03:32 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bMoqY-0001yO-QD for ietf-http-wg-dist@listhub.w3.org; Tue, 12 Jul 2016 03:58:58 +0000
Resent-Date: Tue, 12 Jul 2016 03:58:58 +0000
Resent-Message-Id: <E1bMoqY-0001yO-QD@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 <yanick.rochon@gmail.com>) id 1bMoqU-0001x8-2o for ietf-http-wg@listhub.w3.org; Tue, 12 Jul 2016 03:58:54 +0000
Received: from mail-vk0-f41.google.com ([209.85.213.41]) by maggie.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <yanick.rochon@gmail.com>) id 1bMoqQ-0005DA-20 for ietf-http-wg@w3.org; Tue, 12 Jul 2016 03:58:52 +0000
Received: by mail-vk0-f41.google.com with SMTP id f7so5189344vkb.3 for <ietf-http-wg@w3.org>; Mon, 11 Jul 2016 20:58:29 -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=lRgc88Dosl7DfD4G5zbnvOcBW01BtMuIHRgexW39MXw=; b=Ga0zQfnzeFnlzWREGzVabvF5RyKEp8hejC/YjBXcRI1W4TsEptLhm6WDFKdZMzy+jx JiQhuOjIH74p8zwVe4J/7KKrX1RXUCRWLqjEE6Vc5KWVYQ/fnAPA95qRwRD2URKcZ+uv cIb6z8ZnmP7MCBGySmw7UldQJoKcOnIqaWsTeRUMjC/9Kj54ptoZ8guF6TXzVGThJOfg eUIKRntP5mLJor7NgiX4FQJ45gzKHQt2U7NXuHZPodPBI9HVjqmeJvfCy/Jf/Q42sh0I HF58yHHOY1/pILCvEEv5RbfQe0CXZAIeeQgCU2MfgeJKlzS9F9N8Bz0bbwd+SkxmfU5Q cW2A==
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=lRgc88Dosl7DfD4G5zbnvOcBW01BtMuIHRgexW39MXw=; b=jmJtkzXeMNoUj/16CVIpBQ5/LjhlQCSj/FXDepfVmNpd3BiLL8JuXFXkiVa+g2bHyO lMUrS5nVg2ucvvZe5zii1UhW+7ldckNisBsC4ZD80q+5so/pbW88p7ej5o0YPEqbO233 rLEcpIWU9Tqv0WZb7VeZVm/WuA4sA7/NsKYfieQftZxpolq+p1G7UiObS6GXhliZJ1Tl SAqbTixr88T8o5gW0oKtyMtpBhcd1d67d1HYWL2q/FNHsrmaKN5ogGNCyTMcjZmWHv5W n/a0UMhWtnd3jsnR+9sOT+UWkgMBcO78y2AFFhUZ5GLLyjble2vsICt8cWHlxOX9nJPs pyAg==
X-Gm-Message-State: ALyK8tLsEvi+pmhCIE0Hx0Pt/WVSjZyBgsB7UTQwfWiOhJM5VIRR4Lpa0I8sH38DBR64BqUM/D7fmbtI8/YpDg==
X-Received: by 10.176.64.129 with SMTP id i1mr37076uad.156.1468295903489; Mon, 11 Jul 2016 20:58:23 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.103.45.78 with HTTP; Mon, 11 Jul 2016 20:58:03 -0700 (PDT)
In-Reply-To: <20160712032237.GA10172@1wt.eu>
References: <8854.1468236033@critter.freebsd.dk> <326f0b93-dbd5-3dfb-2a35-d1bf084684b4@gmx.de> <9221.1468245597@critter.freebsd.dk> <aa9cee9c-d8e3-17ba-9fcd-e327575cd5a8@gmx.de> <9801.1468259070@critter.freebsd.dk> <15d27f23-6b51-1e8e-3f10-194c80570424@gmx.de> <20160711190107.GB9542@1wt.eu> <0e467573-4f68-80a5-14a4-5a63b41ac4d4@gmx.de> <20160711192515.GA9614@1wt.eu> <CAB0No9kgPJqMZQ2=qpMw4yh7Tq-1V+nkuagrN71HTTeXYpJ9kA@mail.gmail.com> <20160712032237.GA10172@1wt.eu>
From: Yanick Rochon <yanick.rochon@gmail.com>
Date: Mon, 11 Jul 2016 23:58:03 -0400
Message-ID: <CAB0No9mB-yAoPZqp7AE_HYdVSPicKh2xed4m=Dxfz7vrMD+sjg@mail.gmail.com>
To: Willy Tarreau <w@1wt.eu>
Cc: Julian Reschke <julian.reschke@gmx.de>, Poul-Henning Kamp <phk@phk.freebsd.dk>, Phil Hunt <phil.hunt@oracle.com>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="94eb2c1243d6c0b4a20537684798"
Received-SPF: pass client-ip=209.85.213.41; envelope-from=yanick.rochon@gmail.com; helo=mail-vk0-f41.google.com
X-W3C-Hub-Spam-Status: No, score=-5.5
X-W3C-Hub-Spam-Report: AWL=-0.817, 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: maggie.w3.org 1bMoqQ-0005DA-20 7545b3f0b56b279189b1393bf15db21f
X-Original-To: ietf-http-wg@w3.org
Subject: Re: JSON headers
Archived-At: <http://www.w3.org/mid/CAB0No9mB-yAoPZqp7AE_HYdVSPicKh2xed4m=Dxfz7vrMD+sjg@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/31913
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 11 July 2016 at 23:22, Willy Tarreau <w@1wt.eu> wrote:

> On Mon, Jul 11, 2016 at 03:47:32PM -0400, Yanick Rochon wrote:
> > On 11 July 2016 at 15:25, Willy Tarreau <w@1wt.eu> wrote:
> >
> For me it means it sent two values for the Accept header defined as a list,
> the first one being "appliation/xml...", and the second one
> "text/plain...".
> ... *snip*


> Since it seams easy to me I'm having an issue understanding the deeper
> problem and am pretty sure I missed something :-/
>

Well, first arrays are enclosed in square brackets, nor curly ones :)

Second, I am not talking about the format per se, but about possible
headers being sent as described (i.e. with duplicated keys). Of course,
JavaScript objects cannot have duplicate keys, however JSON representations
as strings are not bound to this limitation, and may very well be sent as
such. (Also, even if it is expected that every values must be an array,
JSON allows a few more possible values to be set, like strings, etc.) The
point is that, { "Accept": "...", "Accept": [ "..." ] } is a valid JSON
object, yet is (or should be) invalid as header value. What then?