From 2e4918c9d7c58ed2e7af6e417512f3dcb7f79dd6 Mon Sep 17 00:00:00 2001 From: Arnaud Dartois Date: Tue, 21 Jul 2026 07:54:15 +0000 Subject: [PATCH] fix(api): remove duplicate /healthz and /readyz minimal API routes HealthController already exposes [HttpGet("/healthz")] and [HttpGet("/readyz")]. The duplicate MapGet in Program.cs caused AmbiguousMatchException on every /healthz request. --- src/Heimdall.Web/Program.cs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/Heimdall.Web/Program.cs b/src/Heimdall.Web/Program.cs index 99bf3fc..ced9e0a 100644 --- a/src/Heimdall.Web/Program.cs +++ b/src/Heimdall.Web/Program.cs @@ -282,25 +282,6 @@ app.UseCors(options => app.UseRateLimiter(); -// ── Health check endpoints for Docker ───────────────────────────── -app.MapGet("/healthz", () => - Results.Ok(new { status = "healthy", timestamp = DateTime.UtcNow })); - -app.MapGet("/readyz", async (HttpContext context) => -{ - try - { - using var scope = context.RequestServices.CreateScope(); - var db = scope.ServiceProvider.GetRequiredService(); - _ = await db.Database.CanConnectAsync(); - return Results.Ok(new { status = "healthy", timestamp = DateTime.UtcNow }); - } - catch - { - return Results.StatusCode(503); - } -}); - // ── Cookie auth endpoints (called from Blazor via JS fetch) ─────── // /_auth/signin — Validates the JWT access token and creates an auth cookie // /_auth/signout — Clears the authentication cookie on logout