From ff468d91ce1f6fc58083af5d7a57e6b0920b852a Mon Sep 17 00:00:00 2001 From: Peter Double Date: Mon, 14 Apr 2025 12:35:32 -0400 Subject: [PATCH] fix: apply pre-commit formatting --- llama_stack/distribution/server/server.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/llama_stack/distribution/server/server.py b/llama_stack/distribution/server/server.py index 3d3c0df2e..f57d359d4 100644 --- a/llama_stack/distribution/server/server.py +++ b/llama_stack/distribution/server/server.py @@ -230,29 +230,23 @@ class TracingMiddleware: self.app = app self.impls = impls # FastAPI built-in paths that should bypass custom routing - self.fastapi_paths = ( - "/docs", - "/redoc", - "/openapi.json", - "/favicon.ico", - "/static" - ) + self.fastapi_paths = ("/docs", "/redoc", "/openapi.json", "/favicon.ico", "/static") async def __call__(self, scope, receive, send): if scope.get("type") == "lifespan": return await self.app(scope, receive, send) path = scope.get("path", "") - + # Check if the path is a FastAPI built-in path if path.startswith(self.fastapi_paths): # Pass through to FastAPI's built-in handlers logger.debug(f"Bypassing custom routing for FastAPI built-in path: {path}") return await self.app(scope, receive, send) - + if not hasattr(self, "endpoint_impls"): self.endpoint_impls = initialize_endpoint_impls(self.impls) - + try: _, _, trace_path = find_matching_endpoint(scope.get("method", "GET"), path, self.endpoint_impls) except ValueError: