]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
fix: include API key in CORS proxy requests for MCP connections (#21193)
authorSATISH K C <redacted>
Tue, 31 Mar 2026 08:52:34 +0000 (03:52 -0500)
committerGitHub <redacted>
Tue, 31 Mar 2026 08:52:34 +0000 (10:52 +0200)
commitfcc2d598c8da431d260da560f8aeeeb181702063
treeae613114d9fbe6494ef786b7bdb50e6421c65bac
parent4453e77561145a350a37141659654d25da113681
fix: include API key in CORS proxy requests for MCP connections (#21193)

* fix: include API key in CORS proxy requests for MCP connections

When llama-server is started with --api-key-file and --webui-mcp-proxy,
the /cors-proxy endpoint requires authentication. The WebUI was not
including the Authorization header in proxy requests, causing MCP
connections to fail with 401.

Inject getAuthHeaders() into requestInit when useProxy is true so the
proxy request carries the Bearer token alongside the forwarded target
headers.

Fixes #21167

* fix: simplify headers assignment based on reviewer suggestion

Apply buildProxiedHeaders only when useProxy is true, pass headers
directly to the transport otherwise.
tools/server/webui/src/lib/services/mcp.service.ts