Skip to content

Commit 96dc504

Browse files
committed
Mv healthcheck endpoitns before proxy
1 parent 16139c8 commit 96dc504

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/stac_auth_proxy/app.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,19 @@ def create_app(settings: Optional[Settings] = None) -> FastAPI:
4545
lifespan=lifespan,
4646
)
4747

48-
# Add catchall proxy handler
48+
if settings.healthz_prefix:
49+
app.include_router(
50+
HealthzHandler(upstream_url=str(settings.upstream_url)).router,
51+
prefix=settings.healthz_prefix,
52+
)
53+
4954
proxy_handler = ReverseProxyHandler(upstream=str(settings.upstream_url))
5055
app.add_api_route(
5156
"/{path:path}",
5257
proxy_handler.stream,
5358
methods=["GET", "POST", "PUT", "PATCH", "DELETE"],
5459
)
5560

56-
if settings.healthz_prefix:
57-
healthz_handler = HealthzHandler(upstream_url=str(settings.upstream_url))
58-
app.include_router(healthz_handler.router, prefix="/healthz")
59-
6061
# Add middleware in reverse order (last added = first to run)
6162
app.add_middleware(AddProcessTimeHeaderMiddleware)
6263

0 commit comments

Comments
 (0)