fix: make healthcheck public (#2209)

This commit is contained in:
Charles Packer 2024-12-10 14:02:05 -08:00 committed by GitHub
parent 7f85a0315b
commit 7472a3d9cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -109,7 +109,13 @@ random_password = os.getenv("LETTA_SERVER_PASSWORD") or generate_password()
class CheckPasswordMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request, call_next):
# Exclude health check endpoint from password protection
if request.url.path == "/v1/health/" or request.url.path == "/latest/health/":
return await call_next(request)
if request.headers.get("X-BARE-PASSWORD") == f"password {random_password}":
return await call_next(request)