]> Cypherpunks repositories - gostls13.git/commitdiff
text/html: escape MIME type "application/ld+json" as JavaScript
authorEvan Klitzke <evan@eklitzke.org>
Mon, 25 Jun 2018 20:27:58 +0000 (20:27 +0000)
committerIan Lance Taylor <iant@golang.org>
Thu, 13 Dec 2018 22:45:02 +0000 (22:45 +0000)
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>
src/html/template/js.go
src/html/template/js_test.go

index 98e821b73c8f2f8319694eb5041c08cb80814db6..872f6786b3555a634ea4542a4aaf901a8ef0845e 100644 (file)
@@ -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",
index 12a850d6e3bfe6df8dd3b1887fd3b42785077bf1..05fa105be02c705bb4d655209c8155412e6ef264 100644 (file)
@@ -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 {