fix(mcp): preserve headers during auth and debug (#31802)
This commit is contained in:
@@ -744,6 +744,7 @@ export const McpDebugCommand = effectCmd({
|
||||
const response = await fetch(serverConfig.url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
...serverConfig.headers,
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json, text/event-stream",
|
||||
},
|
||||
@@ -792,6 +793,7 @@ export const McpDebugCommand = effectCmd({
|
||||
// Try creating transport with auth provider to trigger discovery
|
||||
const transport = new StreamableHTTPClientTransport(new URL(serverConfig.url), {
|
||||
authProvider,
|
||||
requestInit: serverConfig.headers ? { headers: serverConfig.headers } : undefined,
|
||||
})
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user