From 7255170c86416c87d7c92a76f71c72f1d9c15f88 Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Fri, 2 Jan 2026 11:26:24 -0600 Subject: [PATCH] feat(meshchat): fix WebSocket connection handling and expand public path checks for static assets --- meshchatx/meshchat.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/meshchatx/meshchat.py b/meshchatx/meshchat.py index 37e7f67..8802902 100644 --- a/meshchatx/meshchat.py +++ b/meshchatx/meshchat.py @@ -1651,12 +1651,26 @@ class ReticulumMeshChat: # check if path is public is_public = any(path.startswith(public) for public in public_paths) + + # Allow WebSocket connections without auth if it's the handshake/upgrade request + # Real auth for WS happens inside the connection if needed, or by cookie + if path == "/ws": + return await handler(request) # check if requesting setup page (index.html will show setup if needed) if ( path == "/" or path.startswith("/assets/") or path.startswith("/favicons/") + or path.endswith(".js") + or path.endswith(".css") + or path.endswith(".json") + or path.endswith(".wasm") + or path.endswith(".png") + or path.endswith(".jpg") + or path.endswith(".jpeg") + or path.endswith(".ico") + or path.endswith(".svg") ): is_public = True