mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
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:
parent
13b590c8ec
commit
deef6c1937
2 changed files with 4 additions and 5 deletions
|
|
@ -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 }),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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, {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue