fix(mcp): refuse panel requests to routes reached through a dot suffix

The server routes a mounted path when a dot follows it, so /mcp.json reached
the MCP endpoint while panel_request refused only /mcp and /mcp/...; the same
held for the provider-settings, credential and model routes. The refusals now
match a dot after the route as well. A regression test drives panel_request
against a real Vite server.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Sameh KhamisandClaude Opus 5.5 committed 2026-10-02 20:10:47 -07:00
1 parent 6cdd6c8af9
commit 81513f9aae
5 files changed
+109 -8

No files matched your search

+6
View File
@@ -234,6 +234,12 @@ test('routes the panel never loads are refused in any case or encoding', async (
'/api/%4fpenai/hud-summary',
'/mcp',
'/MCP',
// A dot after a mounted route still reaches it.
'/mcp.json',
'/MCP.json',
'/api/setup.json',
'/api/realtime.token',
'/api/OpenAI.x/hud-summary',
'/@fs/etc/passwd',
'/@vite/client',
'/%40fs/x',