fix: use globalLitellmHeaderName instead of hardcoded Authorization headers

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Krrish Dholakia 2026-07-01 06:38:15 +00:00
parent 13b590c8ec
commit deef6c1937
2 changed files with 4 additions and 5 deletions

View file

@ -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<ByokCredentialModalProps> = ({
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${accessToken}`,
[getGlobalLitellmHeaderName()]: `Bearer ${accessToken}`,
},
body: JSON.stringify({ credential: apiKey.trim(), save: saveKey }),
});

View file

@ -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, {