From e20ca9043f84796dd038c7e0c0ef4a7b3d19a65a Mon Sep 17 00:00:00 2001 From: Neil Twigg Date: Wed, 4 Oct 2023 17:18:47 +0100 Subject: [PATCH] Don't append empty slices in the unfragmented path Signed-off-by: Neil Twigg --- server/websocket.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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