Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

test: Add edge case for DemoModeMiddleware WebSocket POST upgrade

rcourtman15906fa33378
diff --git a/internal/api/demo_middleware_test.go b/internal/api/demo_middleware_test.go
index 00687411d4..a023c76d28 100644
--- a/internal/api/demo_middleware_test.go
+++ b/internal/api/demo_middleware_test.go
@@ -44,6 +44,8 @@ func TestDemoModeMiddleware(t *testing.T) {
{"demo on websocket GET", true, http.MethodGet, "/api/ws", "websocket", true, http.StatusOK, true},
{"demo on websocket case insensitive", true, http.MethodGet, "/api/ws", "WebSocket", true, http.StatusOK, true},
{"demo on websocket uppercase", true, http.MethodGet, "/api/ws", "WEBSOCKET", true, http.StatusOK, true},
+ // WebSocket upgrade with POST method (tests websocket branch after GET/HEAD/OPTIONS check)
+ {"demo on websocket POST", true, http.MethodPost, "/api/ws", "websocket", true, http.StatusOK, true},
// Demo mode enabled - auth endpoints allowed (POST)
{"demo on login", true, http.MethodPost, "/api/login", "", true, http.StatusOK, true},