style(mcp): satisfy black formatting

This commit is contained in:
gym-cmd 2026-05-15 17:47:25 +01:00
parent dee5d55a0b
commit dfb1e33483
2 changed files with 3 additions and 1 deletions

View file

@ -13,6 +13,7 @@ from litellm.proxy.auth.ip_address_utils import IPAddressUtils
# must not be cached — both success and error bodies may reveal secrets.
TOKEN_NO_CACHE_HEADERS = {"Cache-Control": "no-store", "Pragma": "no-cache"}
def get_request_base_url(request: Request) -> str:
"""
Get the base URL for the request, considering X-Forwarded-* headers.

View file

@ -15276,7 +15276,8 @@ async def dynamic_mcp_route(mcp_server_name: str, request: Request):
# Create a new scope with the correct path format that the MCP handler expects
# Transform /{mcp_server_name}/mcp to /mcp/{mcp_server_name}
scope = dict(request.scope)
scope["_original_path"] = scope.get("path", "") # preserve for 401 URL form selection
# Preserve the public request path for OAuth challenge URL selection.
scope["_original_path"] = scope.get("path", "")
scope["path"] = f"/mcp/{mcp_server_name}"
# Import the MCP handler