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
This commit is contained in:
aitbc
2026-04-30 12:32:42 +02:00
parent 85034afbb9
commit 11030a3980

View File

@@ -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: