Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion miles/rollout/session/session_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,13 @@ def build_proxy_response(self, result: dict) -> Response:
# verbatim breaks uvicorn h11 with "Too much data for declared
# Content-Length" whenever our re-serialization differs in even one
# byte. Mirrors the strip already done on the request path in do_proxy.
# Also strip "server": uvicorn adds its own Server header; passing
# the upstream one through produces two Server headers, which strict
# HTTP parsers (aiohttp/llhttp via litellm) reject as malformed.
headers = {
k: v
for k, v in result["headers"].items()
if k.lower() not in ("content-length", "transfer-encoding")
if k.lower() not in ("content-length", "transfer-encoding", "server")
}
content_type = headers.get("content-type", "")
try:
Expand Down
Loading