]> Cypherpunks repositories - gostls13.git/commit
html/template: escape JS in application/json script tag
authorNodir Turakulov <nodir@google.com>
Sat, 3 Dec 2016 19:37:05 +0000 (11:37 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sun, 4 Dec 2016 02:33:58 +0000 (02:33 +0000)
commit37dbc7b49cbc9934c8dde54b65e5f417ce3faae9
treedd96f961b47c335331cd7a6b327c04fdebae0a43
parentd29f72f4728b75314b72337e9768c73eb22338e0
html/template: escape JS in application/json script tag

Since ffd1c781b77aab542713b66ef387fa9307e4060b HTML templates check
MIME type in the "type" attribute of "script" tag to decide if contents
should be escaped as JavaScript. The whitelist of MIME types did not
include application/json. Include it in this CL.

Fixes #18159

Change-Id: I17a8a38f2b7789b4b7e941d14279de222eaf2b6a
Reviewed-on: https://go-review.googlesource.com/33899
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/html/template/js.go