Re: [Json] JSON in Web Pages. Was: Go JSON parser ignores the case of member names

Anders Rundgren <anders.rundgren.net@gmail.com> Thu, 10 March 2016 12:58 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0CBBF12D725 for <json@ietfa.amsl.com>; Thu, 10 Mar 2016 04:58:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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 HZJvVPJHoZG1 for <json@ietfa.amsl.com>; Thu, 10 Mar 2016 04:58:19 -0800 (PST)
Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2221C12D721 for <json@ietf.org>; Thu, 10 Mar 2016 04:58:16 -0800 (PST)
Received: by mail-wm0-x235.google.com with SMTP id l68so27479848wml.1 for <json@ietf.org>; Thu, 10 Mar 2016 04:58:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=g4RpO1PSf9tccmGhaSvhABwgUTF5qnKF3pPB12aHabA=; b=HRl+3tYrQoFTG67jUqBjP/unC2fSGfDuqQApn2thAB5hJCBHLuk0Di5/xvvP4/nSal lrsZFwVA8cv8dPzJdjxkl0IMC0jW1aUM38yXALHO0duCny9tSpIV9g4iemOB+Q32C0Ls svQRxxXAXLymmoi4i1/wQz96JW3V02Dg9k5cojf6hdTuzBDASjXFx5w+KJxp6rZqfS36 +dvR/vvOIJgFcndoFfj/O/lY7CQSkLQGoZ544ktmvju7H5c9H38CuKPHNSUuJJcIRhIe Lhrbf4RxANo7zKi5cqckcquhkntn5LoMi+OSdmyZzFVgigvmIVQTfeGDA/RzkttwAOx0 eI/w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=g4RpO1PSf9tccmGhaSvhABwgUTF5qnKF3pPB12aHabA=; b=U0y3JA21rkR1VEE/h6c0h/ubOxPYgoIPXkmx8ytrg+CzIcR+E6eMz/i93ydRQLOwfU dLjZzcJlnkq5PdBD31PIa/UnOZLG3jzeTV0W3+U9sOO6QC7rLjQAT/YGgTLbk/dhU2sc 12+ZIjfnPmjfoe04Y085E0KH+bv1gI5jTjpwOMotvIQatu/iKkkm2E3QOW9C8LJATfVf d/c9zjFxpTcJqCwlAbMERKaXyFo5lbMmX8o3U44vDOkopc951tNxQQoDE1ib9hYLuOKv emcVBG+2jI4m1wg8kkeNX0L34SjJ06mYC8etiZGtQXC3j2gcSSNbWPjB1+nLHM7l531P W9/g==
X-Gm-Message-State: AD7BkJK7np6vDAhVYLYE6cO7LV2P5ZidAlPCY2yaBpmHzuP7FXBnQHATfdXPZ6BhR49i3Q==
X-Received: by 10.28.95.131 with SMTP id t125mr3881062wmb.80.1457614694658; Thu, 10 Mar 2016 04:58:14 -0800 (PST)
Received: from [192.168.1.79] (83.203.130.77.rev.sfr.net. [77.130.203.83]) by smtp.googlemail.com with ESMTPSA id w15sm1134330wmd.10.2016.03.10.04.58.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Mar 2016 04:58:13 -0800 (PST)
To: "Manger, James" <James.H.Manger@team.telstra.com>, John Cowan <cowan@mercury.ccil.org>, Rob Sayre <sayrer@gmail.com>
References: <255B9BB34FB7D647A506DC292726F6E13BBE5873A1@WSMSG3153V.srv.dir.telstra.com> <20160309012028.GQ32247@mercury.ccil.org> <CAChr6SyGoRO-CgH5cPSXLLhnqkd5kJb9XpJ-evgJ1kB=mUot9A@mail.gmail.com> <20160309213830.GB9515@mercury.ccil.org> <CAChr6SwdCcb=xd+K4J2tbDqKSmqWjEoO8DKhb1QrtG9KEo28rw@mail.gmail.com> <20160310021502.GD9515@mercury.ccil.org> <255B9BB34FB7D647A506DC292726F6E13BBE7517EF@WSMSG3153V.srv.dir.telstra.com> <56E148D4.9030204@gmail.com>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
Message-ID: <56E16F43.9040705@gmail.com>
Date: Thu, 10 Mar 2016 13:57:39 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <56E148D4.9030204@gmail.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/8JSP1egi3akyW57ruX4LiGtO72A>
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] JSON in Web Pages. Was: Go JSON parser ignores the case of member names
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 10 Mar 2016 12:58:21 -0000

On 2016-03-10 11:13, Anders Rundgren wrote:
https://github.com/golang/go/issues/14749

> On 2016-03-10 05:55, Manger, James wrote:
>
>> P.S. Another interesting feature of the standard JSON package in Go is that it ALWAYS escapes
>> "<" as "\u003c" - as a safety feature, in case the JSON is used within HTML.
>
> Whow James, you are a true genius for finding difficult spots!
>
> My JSON tools have be upgraded to support JSON-serializable JavaScript objects
> intended for usage in Web pages.  That's great but (of course...) I had overlooked
> the case you mentioned:
>
> <html...>
>
> <script>
>
> var jsonData = {
>     trouble: "</script>"
> };
>
> FAIL!
>
> That is, you really have to do as Go which fortunately have no practical implications
> since an ES6 compatible serializer will anyway produce the right (normalized) result
> during signature verification.  Sometimes you need a little bit of luck as well...
>
> Anders
>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json
>