Skip to content

Commit 784d810

Browse files
eklitzkeianlancetaylor
authored andcommitted
text/html: escape MIME type "application/ld+json" as JavaScript
Fixes #26053 Change-Id: Ic2052b1d0d4e0826a217a520c83d7bb0995ea72a GitHub-Last-Rev: 5a3eea3 GitHub-Pull-Request: #26054 Reviewed-on: https://go-review.googlesource.com/c/120835 Reviewed-by: Emmanuel Odeke <[email protected]>
1 parent c3b9a72 commit 784d810

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/html/template/js.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ func isJSType(mimeType string) bool {
391391
"application/ecmascript",
392392
"application/javascript",
393393
"application/json",
394+
"application/ld+json",
394395
"application/x-ecmascript",
395396
"application/x-javascript",
396397
"text/ecmascript",

src/html/template/js_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ func TestIsJsMimeType(t *testing.T) {
343343
{"application/javascript/version=1.8", false},
344344
{"text/javascript", true},
345345
{"application/json", true},
346+
{"application/ld+json", true},
346347
}
347348

348349
for _, test := range tests {

0 commit comments

Comments
 (0)