aboutsummaryrefslogtreecommitdiff
path: root/internal/net/wsconn.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/net/wsconn.go')
-rw-r--r--internal/net/wsconn.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/net/wsconn.go b/internal/net/wsconn.go
index d6f45dc..4990c0b 100644
--- a/internal/net/wsconn.go
+++ b/internal/net/wsconn.go
@@ -9,6 +9,9 @@ type wsConn struct {
}
func newWSConn(conn *websocket.Conn) *wsConn {
+ // Bound incoming message size so a client cannot push arbitrarily large
+ // frames into memory before the session's truncation logic runs.
+ conn.SetReadLimit(maxLineLength * 4)
return &wsConn{conn: conn}
}