fix(mcp): return non-Bearer auth tokens as-is in _extract_bearer_token

This commit is contained in:
Ishaan Jaffer 2026-05-01 11:57:16 -07:00
parent 4800446b2f
commit d9e09c6b14
No known key found for this signature in database

View file

@ -1177,8 +1177,10 @@ class MCPServerManager:
# raw_headers may have lowercase keys depending on the ASGI server
normalized = {k.lower(): v for k, v in raw_headers.items()}
auth_value = normalized.get("authorization")
if auth_value and auth_value.startswith("Bearer "):
return auth_value[len("Bearer "):]
if auth_value:
if auth_value.startswith("Bearer "):
return auth_value[len("Bearer "):]
return auth_value
return None
def _build_stdio_env(