Tidy up CORS error catching
This commit is contained in:
parent
aad2badb2f
commit
26b47438c6
1 changed files with 5 additions and 4 deletions
|
|
@ -170,11 +170,12 @@ export async function discoverOAuthMetadata(
|
|||
"MCP-Protocol-Version": opts?.protocolVersion ?? LATEST_PROTOCOL_VERSION
|
||||
}
|
||||
});
|
||||
} catch {
|
||||
try {
|
||||
} catch (error) {
|
||||
// CORS errors come back as TypeError
|
||||
if (error instanceof TypeError) {
|
||||
response = await fetch(url);
|
||||
} catch {
|
||||
return undefined;
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue