Re: JSON headers

Martin J. Dürst <duerst@it.aoyama.ac.jp> Mon, 11 July 2016 04:10 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 1271C12B04F for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 10 Jul 2016 21:10:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.208
X-Spam-Level:
X-Spam-Status: No, score=-8.208 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.287, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=itaoyama.onmicrosoft.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 vcKsPY9Mmj2Q for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 10 Jul 2016 21:10:24 -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 A451B128B44 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sun, 10 Jul 2016 21:10:24 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bMSUI-0005qh-Ib for ietf-http-wg-dist@listhub.w3.org; Mon, 11 Jul 2016 04:06:30 +0000
Resent-Date: Mon, 11 Jul 2016 04:06:30 +0000
Resent-Message-Id: <E1bMSUI-0005qh-Ib@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 <duerst@it.aoyama.ac.jp>) id 1bMSUC-0005p6-Mw for ietf-http-wg@listhub.w3.org; Mon, 11 Jul 2016 04:06:24 +0000
Received: from mail-os2jpn01on0092.outbound.protection.outlook.com ([104.47.92.92] helo=JPN01-OS2-obe.outbound.protection.outlook.com) by maggie.w3.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from <duerst@it.aoyama.ac.jp>) id 1bMSU9-00010r-UE for ietf-http-wg@w3.org; Mon, 11 Jul 2016 04:06:24 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itaoyama.onmicrosoft.com; s=selector1-it-aoyama-ac-jp; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=m5pjoqmhjAPDb2+MhbKnm4qnyq0vSUpvdBT2RA+6v1Q=; b=w7f2uO6b4PBF4PP3ADyKbF/OUJsV4bmKHXS8d/q/WQMB7USgL/xvlJBo0U6mOCMs2WM+6lkq301FbnGg6Kd/7TQpQj02VyAg7CWFPb0hchzJJyxur9lKN443X529CbnE6KfD1v50sPB9APDmZq4yp3JMVzNehMyCKGm1b/L8LNg=
Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=duerst@it.aoyama.ac.jp;
Received: from [133.2.210.64] (133.2.210.64) by OS2PR01MB0914.jpnprd01.prod.outlook.com (10.167.178.20) with Microsoft SMTP Server (TLS) id 15.1.539.14; Mon, 11 Jul 2016 04:05:50 +0000
To: Poul-Henning Kamp <phk@phk.freebsd.dk>, Julian Reschke <julian.reschke@gmx.de>
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> <CAB0No9kf6gje3Tc+impphV5tUHjksCkL1PJ1YAgNjXO+tLq=XA@mail.gmail.com> <176d58df-debf-e660-edf7-7d686c926ef6@gmx.de> <5939.1468189218@critter.freebsd.dk>
CC: Yanick Rochon <yanick.rochon@gmail.com>, Phil Hunt <phil.hunt@oracle.com>, HTTP Working Group <ietf-http-wg@w3.org>
From: "Martin J. Dürst" <duerst@it.aoyama.ac.jp>
Organization: Aoyama Gakuin University
Message-ID: <94d7c36a-7d6d-11bf-27b6-2e6a2b807b09@it.aoyama.ac.jp>
Date: Mon, 11 Jul 2016 13:05:44 +0900
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
MIME-Version: 1.0
In-Reply-To: <5939.1468189218@critter.freebsd.dk>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Originating-IP: [133.2.210.64]
X-ClientProxiedBy: TY1PR01CA0048.jpnprd01.prod.outlook.com (10.164.162.158) To OS2PR01MB0914.jpnprd01.prod.outlook.com (10.167.178.20)
X-MS-Office365-Filtering-Correlation-Id: 1835e5b2-03c8-4587-9d2e-08d3a940a539
X-Microsoft-Exchange-Diagnostics: 1; OS2PR01MB0914; 2:vgFaBjkdJeaYZxQwcZ59yu2AISesXLUjf9jEsnoCRiKnjT62cjhDeslXVhzqaVzcHbfrJ3TBT6ykkW4DQ348NzNZ1gzSF/E7R9ZvqnfztVvMu+2SpBZhdnAth+FPo9DCekGHcj9/acHL8iZkB1x0aNRDIs8YGqTRBHua/8waaGsGGvMxl8Q7SfE0hbI202dw; 3:JPill6qwPOtNZGwTyV3ko/nLVtIVo8sNs1f4BTq4wwsFJ4Dz5ExlMr6xF/Y95dTfC83CmWmmMQULEaKYoqobzV39S1qpB7/RQyvRqyuPBeCuLviS8KXkHcgwHQQ9gTYr; 25:u1rMNB1T8ByV8ODyJzA06DRi5RVZ5IUjin010mya/7fb7ev3dJj4YNzuHi09oRlwL6b+ifcL/pqexFYPG95kb7OGB2VwFX3I2iGpEP/CIFY+FnY5bhjoVe0jhkMFMGhdXsOtwyWTtLBb+atCh+346c1eEp2JnB0q8tYctNyUUp0geZVlgtfvPWDzX5mfRZ5Pya2gYlfCzT8KuByikWqzhN0Wcn74uynG8+fheaTz7K/djIHHtgVIe1xE1xbxTwR0DHOnH7OSilkrcylhVMSehzgeScsv8J1pAS6tRkC9RM94YgkVGYQVjfwQUL2MpKrOidH4RYo/BUN6FcTqd3D/roZs3WHgvNn0T34RzZiBa8eiTG5aQbHBm8Doc3hdC76PpewLNNr/js3QN3ciaEsspRXWWbLfx/ZBy/k/oonuVLA=; 31:N+ZDj4+0HxFyJtWUi3IeYfMnxdLhJrRMgkbHQBHge+7YsnQen3+x0xY4AWrx3U10OJgLDCFWhoBnBXm06slIR1YGHh+9LGieGr7WSQgGYYpK7g6TW1o9GTWRsb5ao3iwb8ri76R6aOtUiOnPQ8I/J7arDRMH/XUL5DYdFwMvo8SfDSsHLCrZ2fHuDHiaXTW25yqjhmeWNgRUpTlfIXiF/Q==
X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:OS2PR01MB0914;
X-Microsoft-Antispam-PRVS: <OS2PR01MB0914A0E77975C825833F4DABCA3F0@OS2PR01MB0914.jpnprd01.prod.outlook.com>
X-Exchange-Antispam-Report-Test: UriScan:;
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040130)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041072)(6043046)(6042046); SRVR:OS2PR01MB0914; BCL:0; PCL:0; RULEID:; SRVR:OS2PR01MB0914;
X-Microsoft-Exchange-Diagnostics: 1; OS2PR01MB0914; 4:KFfo0uwHxeKRbc1XNrZ7CJyBxjaM6Gf5q1jrGWfPVsbJQbPlycvQxOXgFPAb5oQhxfU2Dab1h2eUEcUZQtAaNRhrjOVi9XzT1ywZYnCSRNC5U3uCFKtmdpW7Fs94ewgoLUl45cmEJoYrEouZynpJYZsqP6Mvh+zksJAjiIThuwkHdyDgX4DsX7mjiKOB9BXPURuNFiS2Ua4KJcSiaN+g+WmAtxz8WlfSVqeNc79EB/o9lmg9C0s3/ZmFvBPWcYV1m7Y3gE2k8nTm4VxCJEz+oujhjQoaydxIT39nHoHjz3KwnHtm6iSrtwPZLz1qGIwN0KUi6fMTDHPfb0oQis8munZuUvEf0KbGMexvtvFAodoIOUm4FmyseWbH6ufwz9YZ+RUXgrutbhKcIuUvLPaZx4s4zBVyDVa20UnlgONCEWE=
X-Forefront-PRVS: 00003DBFE7
X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(199003)(189002)(24454002)(54356999)(31686004)(5001770100001)(221733001)(93886004)(64126003)(305945005)(101416001)(105586002)(47776003)(189998001)(4001350100001)(97736004)(7846002)(6116002)(586003)(76176999)(7736002)(42186005)(3846002)(50986999)(106356001)(65956001)(86362001)(8666005)(23676002)(65806001)(74482002)(92566002)(83506001)(2950100001)(81156014)(50466002)(4326007)(81166006)(68736007)(8676002)(230700001)(33646002)(31696002)(66066001)(2906002)(77096005)(3480700004)(65826006)(7059030)(3940600001); DIR:OUT; SFP:1102; SCL:1; SRVR:OS2PR01MB0914; H:[133.2.210.64]; FPR:; SPF:None; PTR:InfoNoRecords; A:0; MX:1; LANG:en;
Received-SPF: None (protection.outlook.com: it.aoyama.ac.jp does not designate permitted sender hosts)
X-Microsoft-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jZZ05jd41MYYj1bAnCfTT+SkQaga3pwkU6JswF37MFNwfvfRMGJBN90EcMHFY4bP8bJsIi
SpamDiagnosticOutput: 1:99
SpamDiagnosticMetadata: NSPM
X-OriginatorOrg: it.aoyama.ac.jp
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2016 04:05:50.2717 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS2PR01MB0914
Received-SPF: pass client-ip=104.47.92.92; envelope-from=duerst@it.aoyama.ac.jp; helo=JPN01-OS2-obe.outbound.protection.outlook.com
X-W3C-Hub-Spam-Status: No, score=-6.3
X-W3C-Hub-Spam-Report: AWL=-0.419, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: maggie.w3.org 1bMSU9-00010r-UE 84181ba3ee625f2639fd35c9733f16de
X-Original-To: ietf-http-wg@w3.org
Subject: Re: JSON headers
Archived-At: <http://www.w3.org/mid/94d7c36a-7d6d-11bf-27b6-2e6a2b807b09@it.aoyama.ac.jp>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/31868
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>

Hello Paul-Henning,

On 2016/07/11 07:20, Poul-Henning Kamp wrote:

> If we instead, as I propose, require that JSON headers *never* be
> split, then it becomes both possible and rather obviously smarter
> to define this header as a JSON object, keyed by the media type:
>
> 	Accept: { 					\
> 		"text/plain": <JSON for "q=0.5">,	\
> 		"text/html": <JSON for no parameter>,	\
> 		"text-xdvi": <JSON for "q=0.8">,	\
> 		"text/x-c": <JSON for no parameter>	\
> 	}
>
> A sender wishing to modify the priority, just sets the
> corresponding JSON object using the native languages
> JSON facility:
>
> 	req.accept["text/plain"] = <JSON for "q=0">

My understanding is that you are extremely concerned about the speed at 
which headers can be processed. My guess would be that deserializing, 
changing, and reserialising JSON headers takes more time than 
detecting/processing duplicate headers. But I of course might be wrong.

Could you give some more background on why speed-wise, de/serializing is 
okay for you, but duplicate detection isn't?

> But this time we can shut them all with one single line of text:
>
> 	"Duplicate keys in JSON objects SHALL cause and be treated
> 	as connection failure."

How are you going to tell your favorite JSON library to behave that way?

Regards,   Martin.