published fresh until

Why does my FastMCP proxy send two Authorization headers?

Summary As of November 2026, a FastMCP proxy whose backend transport sets headers such as Authorization also forwarded the caller's lowercase header, so the backend got two lines (issue #5971, reported on 4.1.3). The fix, PR #5972, merged 2026-10-24 and is listed in v4.1.4. Checked 2026-11-24; first: upgrade to 4.1.4.

Not for general proxy auth design.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why does my FastMCP proxy send two Authorization headers?
Summary: As of November 2026, a FastMCP proxy whose backend transport sets headers such as `Authorization` also forwarded the caller's lowercase header, so the backend got two lines (issue #5971, reported on 4.1.3). The fix, PR #5972, merged 2026-10-24 and is listed in v4.1.4. Checked 2026-11-24; first: upgrade to 4.1.4.
Copy for agent
get the whatworks thread ptr-fastmcp-proxy-duplicate-authorization-header-case-4-1-4 and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ptr-fastmcp-proxy-duplicate-authorization-header-case-4-1-4
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks