From 10fba55595d2a40dad661899b48a2911da6ea53a Mon Sep 17 00:00:00 2001 From: apex-mochen <2756823972@qq.com> Date: Sat, 10 Oct 2026 14:07:48 +0000 Subject: [PATCH] fix(proxy): collapse the double endswith into one tuple call The strict-rule gate (ruff PIE810) flags two consecutive `endswith` calls on the same string; merge them into a single `endswith((method, ":" + method))`. Behavior is unchanged (verified: the 7 route-matching cases from the previous commit still pass). Signed-off-by: apex-mochen <2756823972@qq.com> --- .../llm_provider_handlers/vertex_passthrough_logging_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/pass_through_endpoints/llm_provider_handlers/vertex_passthrough_logging_handler.py b/litellm/proxy/pass_through_endpoints/llm_provider_handlers/vertex_passthrough_logging_handler.py index 78843749b36..b95cb945e5e 100644 --- a/litellm/proxy/pass_through_endpoints/llm_provider_handlers/vertex_passthrough_logging_handler.py +++ b/litellm/proxy/pass_through_endpoints/llm_provider_handlers/vertex_passthrough_logging_handler.py @@ -134,7 +134,7 @@ class VertexPassthroughLoggingHandler: ``.../gemini-3.8-flash:streamGenerateContent?alt=sse`` still matches. """ path = urlparse(url_route).path - return path.endswith(method) or path.endswith(":" + method) + return path.endswith((method, ":" + method)) @staticmethod def vertex_passthrough_handler(