diff --git a/api.py b/api.py index e657216..cb475a5 100644 --- a/api.py +++ b/api.py @@ -103,10 +103,17 @@ def root(): } -@app.get("/health") +@app.api_route("/health", methods=["GET", "HEAD"]) def health(): - """Health check — sem autenticação.""" - return {"status": "ok", "version": API_VERSION, "auth": is_auth_enabled()} + """Health check — sem autenticação. Suporta GET e HEAD (Docker Swarm).""" + from fastapi.responses import JSONResponse + return JSONResponse( + content={"status": "ok"}, + headers={ + "X-Api-Status": "ok", + "X-Api-Version": API_VERSION, + }, + ) # ── Endpoints Protegidos ────────────────────────────────────────────