text/html: MIME type "application/ld+json: should be escaped as JS

Teach the text/html package to understand the "application/ld+json" MIME
type (used for JSON-LD data) as JS, so it can be apply the correct contextual
escaping.

Fixes #26053
This commit is contained in:
Evan Klitzke 2018-06-25 13:17:44 -07:00
parent d6a27e8edc
commit 5a3eea3dd2
No known key found for this signature in database
GPG Key ID: 7A766318010B82C3
2 changed files with 2 additions and 0 deletions

View 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",

View 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 {