This commit is contained in:
ihrpr 2025-05-19 19:03:22 +01:00
commit 2f6a9fca11
No known key found for this signature in database
2 changed files with 9 additions and 9 deletions

View file

@ -252,8 +252,8 @@ export function useConnection({
const handleAuthError = async (error: unknown) => { const handleAuthError = async (error: unknown) => {
const is401Error = const is401Error =
(error instanceof SseError && error.code === 401) || (error instanceof SseError && error.code === 401) ||
(error instanceof Error && error.message.includes('401')) || (error instanceof Error && error.message.includes("401")) ||
(error instanceof Error && error.message.includes('Unauthorized')); (error instanceof Error && error.message.includes("Unauthorized"));
if (is401Error) { if (is401Error) {
const serverAuthProvider = new InspectorOAuthClientProvider(sseUrl); const serverAuthProvider = new InspectorOAuthClientProvider(sseUrl);
@ -377,9 +377,9 @@ export function useConnection({
const clientTransport = const clientTransport =
transportType === "streamable-http" transportType === "streamable-http"
? new StreamableHTTPClientTransport(mcpProxyServerUrl as URL, { ? new StreamableHTTPClientTransport(mcpProxyServerUrl as URL, {
sessionId: undefined, sessionId: undefined,
...transportOptions, ...transportOptions,
}) })
: new SSEClientTransport(mcpProxyServerUrl as URL, transportOptions); : new SSEClientTransport(mcpProxyServerUrl as URL, transportOptions);
if (onNotification) { if (onNotification) {
@ -434,8 +434,8 @@ export function useConnection({
} }
const is401Error = const is401Error =
(error instanceof SseError && error.code === 401) || (error instanceof SseError && error.code === 401) ||
(error instanceof Error && error.message.includes('401')) || (error instanceof Error && error.message.includes("401")) ||
(error instanceof Error && error.message.includes('Unauthorized')); (error instanceof Error && error.message.includes("Unauthorized"));
if (is401Error) { if (is401Error) {
// Don't set error state if we're about to redirect for auth // Don't set error state if we're about to redirect for auth

View file

@ -29,8 +29,8 @@ export default function mcpProxy({
error: { error: {
code: -32001, code: -32001,
message: error.message, message: error.message,
data: error data: error,
} },
}; };
transportToClient.send(errorResponse).catch(onClientError); transportToClient.send(errorResponse).catch(onClientError);
} }