diff --git a/server/websocket.go b/server/websocket.go index cd4b80ae..8163568d 100644 --- a/server/websocket.go +++ b/server/websocket.go @@ -1340,7 +1340,9 @@ func (c *client) wsCollapsePtoNB() (net.Buffers, int64) { if mask { wsMaskBuf(key, p) } - bufs = append(bufs, h, p) + if ol > 0 { + bufs = append(bufs, h, p) + } csz = len(h) + ol } // Add to pb the compressed data size (including headers), but