Skip to content

Commit 20bd8ac

Browse files
committed
fix: limit max close message size
1 parent db1e86c commit 20bd8ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

proxy/websocket.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ func (p *Websocket) closeWebsocket(conn *websocket.Conn, reason error) error {
381381

382382
return errors.Join(
383383
conn.WriteControl(
384-
websocket.CloseMessage, []byte(reason.Error()), utils.Deadline(p.cfg.proxy.ControlTimeout),
384+
// maxControlFramePayloadSize == 125
385+
websocket.CloseMessage, []byte(reason.Error())[:125], utils.Deadline(p.cfg.proxy.ControlTimeout),
385386
),
386387
conn.Close(),
387388
)

0 commit comments

Comments
 (0)