mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-25 01:02:15 +00:00
style(mcp): satisfy black formatting
This commit is contained in:
parent
dee5d55a0b
commit
dfb1e33483
2 changed files with 3 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue