mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
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:
parent
deef6c1937
commit
032c9ffdb4
1 changed files with 5 additions and 3 deletions
|
|
@ -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, {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue