diff options
author | Evan Klitzke <evan@eklitzke.org> | 2018-06-25 20:27:58 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2018-12-13 22:45:02 +0000 |
commit | 784d810976e6fce946d8202b19f3e3c33beb89a2 (patch) | |
tree | 78d999e91b372ce6ea293b4b4a17f33b3aed3227 /src/html | |
parent | c3b9a723bb407d02e4421ffc4a0208d65ca30f5a (diff) | |
download | go-784d810976e6fce946d8202b19f3e3c33beb89a2.tar.gz go-784d810976e6fce946d8202b19f3e3c33beb89a2.zip |
text/html: escape MIME type "application/ld+json" as JavaScript
Fixes #26053
Change-Id: Ic2052b1d0d4e0826a217a520c83d7bb0995ea72a
GitHub-Last-Rev: 5a3eea3dd22b0a194591ce2294b88cb340df1e8d
GitHub-Pull-Request: golang/go#26054
Reviewed-on: https://go-review.googlesource.com/c/120835
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/template/js.go | 1 | ||||
-rw-r--r-- | src/html/template/js_test.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/html/template/js.go b/src/html/template/js.go index 98e821b73c..872f6786b3 100644 --- a/src/html/template/js.go +++ b/src/html/template/js.go @@ -391,6 +391,7 @@ func isJSType(mimeType string) bool { "application/ecmascript", "application/javascript", "application/json", + "application/ld+json", "application/x-ecmascript", "application/x-javascript", "text/ecmascript", diff --git a/src/html/template/js_test.go b/src/html/template/js_test.go index 12a850d6e3..05fa105be0 100644 --- a/src/html/template/js_test.go +++ b/src/html/template/js_test.go @@ -343,6 +343,7 @@ func TestIsJsMimeType(t *testing.T) { {"application/javascript/version=1.8", false}, {"text/javascript", true}, {"application/json", true}, + {"application/ld+json", true}, } for _, test := range tests { |