diff --git a/docs/control-ui.md b/docs/control-ui.md index e8db8707e..89d24b7b1 100644 --- a/docs/control-ui.md +++ b/docs/control-ui.md @@ -8,8 +8,7 @@ read_when: The Control UI is a small **Vite + Lit** single-page app served by the Gateway under: -- `http://:18789/` (preferred) -- `http://:18789/ui/` (legacy alias) +- `http://:18789/` It speaks **directly to the Gateway WebSocket** on the same port. diff --git a/src/config/config.ts b/src/config/config.ts index 4d84d8316..4047d3742 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -102,7 +102,7 @@ export type CanvasHostConfig = { }; export type GatewayControlUiConfig = { - /** If false, the Gateway will not serve the Control UI (/, /ui/). Default: true. */ + /** If false, the Gateway will not serve the Control UI (/). Default: true. */ enabled?: boolean; }; diff --git a/src/gateway/control-ui.ts b/src/gateway/control-ui.ts index c722de89b..db4a60dd9 100644 --- a/src/gateway/control-ui.ts +++ b/src/gateway/control-ui.ts @@ -87,10 +87,8 @@ export function handleControlUiHttpRequest( const url = new URL(urlRaw, "http://localhost"); - if (url.pathname === "/ui") { - res.statusCode = 302; - res.setHeader("Location", "/"); - res.end(); + if (url.pathname === "/ui" || url.pathname.startsWith("/ui/")) { + respondNotFound(res); return true; } @@ -106,7 +104,6 @@ export function handleControlUiHttpRequest( const rel = (() => { if (url.pathname === ROOT_PREFIX) return ""; - if (url.pathname.startsWith(UI_PREFIX)) return url.pathname.slice(UI_PREFIX.length); if (url.pathname.startsWith("/assets/")) return url.pathname.slice(1); return url.pathname.slice(1); })();