fix: exclude WebSocket from rate limiting to prevent UI lockout

The /ws endpoint was rate limited to 30 connections/minute. After
prolonged use with WebSocket reconnections (network hiccups, browser
tab throttling, etc.), users with many Docker containers would hit
this limit and get stuck with a 'Connecting...' UI.

WebSocket connections are already authenticated via session/API token
and reconnections are normal behavior, so rate limiting is not needed.

Fixes #859 (second report about WebSocket rate limiting after hours of use).
This commit is contained in:
rcourtman 2025-12-19 14:51:52 +00:00
parent fdb6789a63
commit bb2b1d7fb1

View file

@ -136,6 +136,7 @@ func UniversalRateLimitMiddleware(next http.Handler) http.Handler {
skipPaths := []string{
"/api/state", // Real-time state updates
"/api/guests/metadata", // Guest metadata (polled frequently)
"/ws", // WebSocket connections (authenticated, reconnections are normal)
}
for _, path := range skipPaths {
if strings.Contains(r.URL.Path, path) {