mirror of
https://github.com/openai/codex.git
synced 2026-09-08 15:50:34 +00:00
## Why Headers configured for an MCP resource can contain credentials and must not be forwarded to a different origin during OAuth discovery, registration, or token exchange. ## What changed - Apply configured resource headers only to OAuth requests on the MCP resource origin, while allowing OAuth-generated headers to take precedence. - Follow credentialed OAuth redirects only when each destination remains on the resource origin. Preserve redirect method semantics, the overall timeout, the response size limit, and a maximum of 10 redirects. - Use the Codex MCP user agent for requests to authorization-server origins. ## Testing Add coverage for cross-origin header isolation, same-origin dynamic client registration redirects, OAuth header precedence, token refresh, timeout accounting, and response size limits. GitOrigin-RevId: 609d06e2b065e4aa9ca5382b4ae60455f9e26db9