]> Cypherpunks repositories - gostls13.git/commitdiff
html/template: lock in application/json as valid JS test
authorEmmanuel Odeke <emm.odeke@gmail.com>
Sun, 4 Dec 2016 02:45:50 +0000 (18:45 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sun, 4 Dec 2016 03:59:31 +0000 (03:59 +0000)
CL https://go-review.googlesource.com/33899 added
application/json as a mimeType for valid JS. Let's
lock that fix in with a test.

Updates #18159

Change-Id: Ic4dfd8929aebfc5410f796688f081ca06630f672
Reviewed-on: https://go-review.googlesource.com/33901
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Nodir Turakulov <nodir@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

src/html/template/js_test.go

index 58fc37ae3a4d46cad2aa563246cbe5badf88d362..7484f60b54dc6fc6cc8aaa20ffedcb33c028569a 100644 (file)
@@ -341,6 +341,7 @@ func TestIsJsMimeType(t *testing.T) {
                {"application/javascript;version=1.8;foo=bar", true},
                {"application/javascript/version=1.8", false},
                {"text/javascript", true},
+               {"application/json", true},
        }
 
        for _, test := range tests {