mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-17 18:17:52 +00:00
The passthrough helper copied the upstream provider's Server: header (e.g. "cloudflare" from Anthropic) onto the FastAPI response. uvicorn then added its own Server: header on top, producing two Server: lines in the wire response. Strict HTTP parsers (aiohttp's, used in CI's passthrough tests) reject this with "Duplicate 'Server' header found" and the request fails with a 400. Same risk for Date, Content-Length, Connection, Keep-Alive: the ASGI server writes its own copy at serialization time. Forwarding the upstream's value either duplicates the header or lies about the re-serialized body length. Drop these from the forwarded set. Application/business headers (content-type, x-request-id, anthropic-ratelimit-*, etc.) still pass through unchanged.