context_server: Handle bad WWW-Authenticate resource_metadata URLs (#53502)

In MCP OAuth, when the resource_metadata URL from the WWW-Authenticate
header from the MCP server is on the same origin, but points to a broken
endpoint (for example Pydantic Logfire doubles the path component,
producing /mcp/mcp), fall back to the RFC 9728 well-known URIs instead
of failing outright. The header URL is still tried first, as per the MCP
spec.

Release Notes:

- MCP OAuth: Handle bad URLs in WWW-Authenticate by falling back to the
well known authorization server metadata URLs.
770e20c839Tom Houlé committed on 5/18/2026, 12:48:55 PM· committed by GitHubparent6834017
1 file changedLine totals unavailable