html escape 비활성화
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package wshandler
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
@ -84,13 +85,17 @@ func (r *room) loop(ctx context.Context, conns *map[string]*wsconn) (normalEnd b
|
||||
Body: msg.Body,
|
||||
Tag: append(msg.Tag, tag),
|
||||
}
|
||||
bt, _ := json.Marshal(ds)
|
||||
|
||||
buff := new(bytes.Buffer)
|
||||
enc := json.NewEncoder(buff)
|
||||
enc.SetEscapeHTML(false)
|
||||
enc.Encode(ds)
|
||||
|
||||
for _, conn := range *conns {
|
||||
r.sendMsgChan <- send_msg_queue_elem{
|
||||
to: conn,
|
||||
mt: websocket.TextMessage,
|
||||
msg: bt,
|
||||
msg: buff.Bytes(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user