mirror of
https://github.com/golang/go
synced 2024-11-22 04:14:42 -07:00
html/template: encoding/json does more escaping now, so update the html/template test that uses it.
R=golang-dev, r CC=golang-dev https://golang.org/cl/5714052
This commit is contained in:
parent
99e45e49b7
commit
289a1638aa
@ -223,14 +223,14 @@ func TestEscape(t *testing.T) {
|
||||
`<button onclick='alert("\x3cHello\x3e")'>`,
|
||||
},
|
||||
{
|
||||
"badMarshaller",
|
||||
"badMarshaler",
|
||||
`<button onclick='alert(1/{{.B}}in numbers)'>`,
|
||||
`<button onclick='alert(1/ /* json: error calling MarshalJSON for type *template.badMarshaler: invalid character 'f' looking for beginning of object key string */null in numbers)'>`,
|
||||
},
|
||||
{
|
||||
"jsMarshaller",
|
||||
"jsMarshaler",
|
||||
`<button onclick='alert({{.M}})'>`,
|
||||
`<button onclick='alert({"<foo>":"O'Reilly"})'>`,
|
||||
`<button onclick='alert({"\u003cfoo\u003e":"O'Reilly"})'>`,
|
||||
},
|
||||
{
|
||||
"jsStrNotUnderEscaped",
|
||||
|
Loading…
Reference in New Issue
Block a user