mirror of https://github.com/gorilla/websocket.git
Add SetEscapeHTM into json.
This commit is contained in:
parent
21ab95fa12
commit
52abbe48e9
4
json.go
4
json.go
|
@ -25,7 +25,9 @@ func (c *Conn) WriteJSON(v interface{}) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err1 := json.NewEncoder(w).Encode(v)
|
enc := json.NewEncoder(w)
|
||||||
|
enc.SetEscapeHTML(false)
|
||||||
|
err1 := enc.Encode(v)
|
||||||
err2 := w.Close()
|
err2 := w.Close()
|
||||||
if err1 != nil {
|
if err1 != nil {
|
||||||
return err1
|
return err1
|
||||||
|
|
Loading…
Reference in New Issue