The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | /** Vite's proxy and the server's dev 404 handler must share prefixes to avoid index.html responses or redirect loops. */ |
| 2 | export const DEV_PROXIED_PATH_PREFIXES = ["/api", "/oauth", "/.well-known", "/ws", "/mcp"] as const; |
| 3 | |
| 4 | /** Preserve origins for OAuth metadata validation and /ws cookie-session Origin/Host checks. */ |
| 5 | export const DEV_PROXIED_ORIGIN_PRESERVING_PREFIXES: ReadonlySet<string> = new Set([ |
| 6 | "/oauth", |
| 7 | "/.well-known", |
| 8 | "/mcp", |
| 9 | "/ws", |
| 10 | ]); |
| 11 | |
| 12 | export function isDevProxiedPath(pathname: string): boolean { |
| 13 | return DEV_PROXIED_PATH_PREFIXES.some( |
| 14 | (prefix) => pathname === prefix || pathname.startsWith(`${prefix}/`), |
| 15 | ); |
| 16 | } |