From 4d8e27b01ec3a15d760cca12d22f9cd604cdc7fe Mon Sep 17 00:00:00 2001 From: Flaminel Date: Sun, 15 Feb 2026 15:42:23 +0200 Subject: [PATCH] fixed health endpoints not being anonymous --- code/backend/Cleanuparr.Api/Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/backend/Cleanuparr.Api/Program.cs b/code/backend/Cleanuparr.Api/Program.cs index 361a35f9..43f0b9d0 100644 --- a/code/backend/Cleanuparr.Api/Program.cs +++ b/code/backend/Cleanuparr.Api/Program.cs @@ -147,14 +147,14 @@ app.Init(); var appHub = app.Services.GetRequiredService>(); SignalRLogSink.Instance.SetAppHubContext(appHub); -// Configure health check endpoints before the API configuration -app.MapHealthChecks("/health", new HealthCheckOptions +// Configure health check endpoints as middleware (before auth pipeline) so they don't require authentication +app.UseHealthChecks("/health", new HealthCheckOptions { Predicate = registration => registration.Tags.Contains("liveness"), ResponseWriter = HealthCheckResponseWriter.WriteMinimalPlaintext }); -app.MapHealthChecks("/health/ready", new HealthCheckOptions +app.UseHealthChecks("/health/ready", new HealthCheckOptions { Predicate = registration => registration.Tags.Contains("readiness"), ResponseWriter = HealthCheckResponseWriter.WriteMinimalPlaintext