fix: prevent proxy auth header collision with OAuth token in testMCPToolsListRequest

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:50:43 +00:00
parent deef6c1937
commit 032c9ffdb4

View file

@ -6754,11 +6754,13 @@ export const testMCPToolsListRequest = async (
const headers: Record<string, string> = {
"Content-Type": "application/json",
};
if (accessToken) {
headers[globalLitellmHeaderName] = `Bearer ${accessToken}`;
}
if (oauthAccessToken) {
headers["Authorization"] = `Bearer ${oauthAccessToken}`;
if (accessToken && globalLitellmHeaderName !== "Authorization") {
headers[globalLitellmHeaderName] = `Bearer ${accessToken}`;
}
} else if (accessToken) {
headers[globalLitellmHeaderName] = `Bearer ${accessToken}`;
}
const response = await fetch(url, {