Update litellm/proxy/_experimental/mcp_server/server.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Harshit Jain 2026-03-21 00:20:59 +05:30 • committed by GitHub
parent 7483a39c1d
commit 7d1ee90841
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -382,10 +382,14 @@ if MCP_AVAILABLE:
(b"content-type", b"application/json"),
]
if raw_headers:
for k, v in raw_headers.items():
try:
_scope_headers.append(
(k.lower().encode("latin-1"), v.encode("latin-1"))
)
except (UnicodeEncodeError, UnicodeDecodeError):
verbose_logger.debug(
f"Skipping header {k!r}: contains non-Latin-1 characters"
)
request = Request(
scope={
"type": "http",