From 11030a3980bb65673ac82f00c4982bf26e894e0b Mon Sep 17 00:00:00 2001 From: aitbc Date: Thu, 30 Apr 2026 12:32:42 +0200 Subject: [PATCH] Fix API gateway prefix stripping logic for service routing - Fixed prefix stripping to correctly remove service prefix from path - Gateway now correctly routes requests to microservices - Tested routing to GPU, Marketplace, and Governance services successfully --- apps/api-gateway/src/api_gateway/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/api-gateway/src/api_gateway/main.py b/apps/api-gateway/src/api_gateway/main.py index 3786f20f..1e766cde 100644 --- a/apps/api-gateway/src/api_gateway/main.py +++ b/apps/api-gateway/src/api_gateway/main.py @@ -107,8 +107,9 @@ async def proxy_request(path: str, request: Request) -> Response: # Build target URL target_path = path - if path.startswith(service_config["prefix"]): - target_path = path[len(service_config["prefix"]):].lstrip("/") + prefix = service_config["prefix"].lstrip("/") + if path.startswith(prefix): + target_path = path[len(prefix):].lstrip("/") target_url = f"{service_config['base_url']}/{target_path}" if request.url.query: