mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix(pass_through_endpoints.py): fix check for mapped routes
This commit is contained in:
parent
323389c244
commit
f96f2106f7
1 changed files with 8 additions and 1 deletions
|
|
@ -42,6 +42,7 @@ from litellm.passthrough import BasePassthroughUtils
|
|||
from litellm.proxy._types import (
|
||||
ConfigFieldInfo,
|
||||
ConfigFieldUpdate,
|
||||
LiteLLMRoutes,
|
||||
PassThroughEndpointResponse,
|
||||
PassThroughGenericEndpoint,
|
||||
ProxyException,
|
||||
|
|
@ -979,7 +980,7 @@ def create_pass_through_route(
|
|||
InitPassThroughEndpointHelpers,
|
||||
)
|
||||
|
||||
if not InitPassThroughEndpointHelpers.is_registered_pass_through_route(
|
||||
if not not InitPassThroughEndpointHelpers.is_registered_pass_through_route(
|
||||
route=endpoint
|
||||
):
|
||||
raise HTTPException(
|
||||
|
|
@ -1745,6 +1746,12 @@ class InitPassThroughEndpointHelpers:
|
|||
Returns:
|
||||
bool: True if route is a registered pass-through endpoint, False otherwise
|
||||
"""
|
||||
|
||||
## CHECK IF MAPPED PASS THROUGH ENDPOINT
|
||||
for mapped_route in LiteLLMRoutes.mapped_pass_through_routes.value:
|
||||
if route.startswith(mapped_route):
|
||||
return True
|
||||
|
||||
# Fast path: check if any registered route key contains this path
|
||||
# Keys are in format: "{endpoint_id}:exact:{path}" or "{endpoint_id}:subpath:{path}"
|
||||
# Extract unique paths from keys for quick checking
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue