mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-23 20:39:24 +01:00
backport fix for #2039
UTF8 should always be validated for websockets, regardless of the incoming message type.
This commit is contained in:
parent
b14095f7ba
commit
e07fd9492a
@ -128,9 +128,9 @@ func (wc IRCWSConn) WriteLines(buffers [][]byte) (err error) {
|
||||
}
|
||||
|
||||
func (wc IRCWSConn) ReadLine() (line []byte, err error) {
|
||||
messageType, line, err := wc.conn.ReadMessage()
|
||||
_, line, err = wc.conn.ReadMessage()
|
||||
if err == nil {
|
||||
if messageType == websocket.BinaryMessage && !utf8.Valid(line) {
|
||||
if !utf8.Valid(line) {
|
||||
return line, errInvalidUtf8
|
||||
}
|
||||
return line, nil
|
||||
|
Loading…
Reference in New Issue
Block a user