fix: ping parse failure
This commit is contained in:
@@ -44,6 +44,11 @@ func (c *Conn) ReadPump(ctx context.Context, hub *Hub) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ignore keep-alive pings
|
||||||
|
if string(data) == "ping" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
var msg ClientMessage
|
var msg ClientMessage
|
||||||
if err := json.Unmarshal(data, &msg); err != nil {
|
if err := json.Unmarshal(data, &msg); err != nil {
|
||||||
c.sendError("invalid message format")
|
c.sendError("invalid message format")
|
||||||
|
|||||||
Reference in New Issue
Block a user