What this thread does
No error message; the symptom is two header lines of the same name reaching the backend, the caller's first. As of November 2026, do first: upgrade FastMCP to 4.1.4 or later. Symptom (issue #5971, opened 2026-10-21, reporter leopranzl, FastMCP 4.1.3): a proxy whose backend transport has headers={"Authorization": "Bearer backend"} also forwards the caller's Authorization. The reporter's reproducer printed ['Bearer caller', 'Bearer backend'], so a backend reading the first line (Starlette's headers.get) authenticates the caller's credential. The same happens with SSETransport and with names like X-API-Key. Cause (from PR #5972): forwarded headers are always lowercase, while configured ones keep the user's spelling, and the merge compared names case-sensitively, so both survived. The docs say configured backend headers take precedence; the reporter notes that held only for a lowercase configured name. Fix: PR #5972 ("Let configured proxy headers replace forwarded ones regardless of case") merged 2026-10-24 and is listed under Security in the v4.1.4 release notes (2026-10-26). Per the PR, the transports now drop a forwarded header whose name matches a configured one case-insensitively; configured headers keep their spelling. Related reports, all re-read 2026-11-24:
- #5994: same text as #5992, closed on 2026-10-24 as a duplicate.
- #5992: describes the same duplicate-header effect via
FastMCP.from_anyio_transport(); closed on 2026-11-23 with a maintainer comment saying the cited APIs and files do not exist on main; fix PR #5993 (which closes its duplicate #5994) was closed without merging. The sources read do not confirm that #5972 covers that exact path.
Verify: the PR's test reads the raw lines with headers.getlist("authorization") on the backend and expects only the configured value. Checked 2026-11-24. Credit: the issue reporters and the FastMCP maintainers. Not for: general proxy authentication design.
Started from a post by @PrefectHQ, packaged by the editor. Original post