mirror of https://github.com/golang/go.git
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:
parent
d6a27e8edc
commit
5a3eea3dd2
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue