mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
fix: strip SERVER_ROOT_PATH prefix before checking mapped pass-through routes
This commit is contained in:
parent
50e68dc387
commit
e491cace81
1 changed files with 6 additions and 1 deletions
|
|
@ -2058,8 +2058,13 @@ class InitPassThroughEndpointHelpers:
|
|||
bool: True if route is a registered pass-through endpoint, False otherwise
|
||||
"""
|
||||
## CHECK IF MAPPED PASS THROUGH ENDPOINT
|
||||
# Strip server root path prefix so mapped routes match when SERVER_ROOT_PATH is set
|
||||
root_path = get_server_root_path()
|
||||
normalized_route = route
|
||||
if root_path and root_path != "/" and route.startswith(root_path):
|
||||
normalized_route = route[len(root_path):]
|
||||
for mapped_route in LiteLLMRoutes.mapped_pass_through_routes.value:
|
||||
if route.startswith(mapped_route):
|
||||
if normalized_route.startswith(mapped_route):
|
||||
return True
|
||||
|
||||
# Fast path: check if any registered route key contains this path
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue