From deef6c1937b20385ec9b88c81b21ca92da00787e Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 1 Jul 2026 06:38:15 +0000 Subject: [PATCH] fix: use globalLitellmHeaderName instead of hardcoded Authorization headers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../src/components/mcp_tools/ByokCredentialModal.tsx | 3 ++- ui/litellm-dashboard/src/components/networking.tsx | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/litellm-dashboard/src/components/mcp_tools/ByokCredentialModal.tsx b/ui/litellm-dashboard/src/components/mcp_tools/ByokCredentialModal.tsx index 84203a23950..cca7aa46663 100644 --- a/ui/litellm-dashboard/src/components/mcp_tools/ByokCredentialModal.tsx +++ b/ui/litellm-dashboard/src/components/mcp_tools/ByokCredentialModal.tsx @@ -13,6 +13,7 @@ import { LinkOutlined, } from "@ant-design/icons"; import { MCPServer } from "./types"; +import { getGlobalLitellmHeaderName } from "@/components/networking"; interface ByokCredentialModalProps { server: MCPServer; @@ -56,7 +57,7 @@ export const ByokCredentialModal: React.FC = ({ method: "POST", headers: { "Content-Type": "application/json", - Authorization: `Bearer ${accessToken}`, + [getGlobalLitellmHeaderName()]: `Bearer ${accessToken}`, }, body: JSON.stringify({ credential: apiKey.trim(), save: saveKey }), }); diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index d982956d7a3..4bf8d6a1c88 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -6755,12 +6755,10 @@ export const testMCPToolsListRequest = async ( "Content-Type": "application/json", }; if (accessToken) { - headers["x-litellm-api-key"] = accessToken; + headers[globalLitellmHeaderName] = `Bearer ${accessToken}`; } if (oauthAccessToken) { headers["Authorization"] = `Bearer ${oauthAccessToken}`; - } else if (accessToken) { - headers[globalLitellmHeaderName] = `Bearer ${accessToken}`; } const response = await fetch(url, { @@ -6931,7 +6929,7 @@ export const exchangeMcpOAuthToken = async ({ "Content-Type": "application/x-www-form-urlencoded", }; if (accessToken) { - headers["Authorization"] = `Bearer ${accessToken}`; + headers[globalLitellmHeaderName] = `Bearer ${accessToken}`; } const response = await fetch(url, {