fix(client): let OAuth-derived Authorization override caller-supplied header (#2475)
Signed-off-by: sanjibani <18418553+sanjibani@users.noreply.github.com> Co-authored-by: sanjibani <18418553+sanjibani@users.noreply.github.com> Co-authored-by: Konstantin Konstantinov <KKonstantinov@users.noreply.github.com> Co-authored-by: Konstantin Konstantinov <konstantin@mach5technology.com>
This commit is contained in:
parent
5ecc791d81
commit
b65426158e
1 changed files with 438 additions and 28 deletions
|
|
@ -808,6 +808,13 @@ value to the spec-required `application/json, text/event-stream` (v1 let it repl
|
|||
them). The required media types are always present; additional types are kept for
|
||||
proxy/gateway routing.
|
||||
|
||||
Transport-managed headers now take precedence over same-named entries in
|
||||
`requestInit.headers`: `Authorization` when `authProvider` yields a token,
|
||||
`mcp-protocol-version`, and (Streamable HTTP) `mcp-session-id`. v1 let the configured
|
||||
header win, so a static `Authorization` placeholder kept overriding the OAuth token even
|
||||
after the provider obtained one. A configured `Authorization` value is still sent while
|
||||
the provider has no token, which is what lets a static API key fall back to OAuth.
|
||||
|
||||
`hostHeaderValidation()` and `localhostHostValidation()` moved to
|
||||
`@modelcontextprotocol/express`. The `(allowedHostnames: string[])` signature is the
|
||||
same as every released v1.x — only the import path changes. Framework-agnostic helpers
|
||||
|
|
|
|||
Loading…
Reference in a new issue