From a9625e88ebbfd191d45e605be64d7d9bfcb798ba Mon Sep 17 00:00:00 2001 From: Ash Davies <3853061+DrizzlyOwl@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:36:33 +0100 Subject: [PATCH] Add hint to accept HTTP HEAD on health routes (#631) --- TramsDataApi/Controllers/HealthCheckController.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TramsDataApi/Controllers/HealthCheckController.cs b/TramsDataApi/Controllers/HealthCheckController.cs index b6ce8986..917017e8 100644 --- a/TramsDataApi/Controllers/HealthCheckController.cs +++ b/TramsDataApi/Controllers/HealthCheckController.cs @@ -35,6 +35,7 @@ public HealthCheckController(LegacyTramsDbContext context, ILogger /// String message indicating health status. [HttpGet] + [HttpHead] [SwaggerOperation(Summary = "Performs a basic health check", Description = "Checks if the API is operational.")] [SwaggerResponse(200, "API is healthy.")] public string Get() @@ -48,6 +49,7 @@ public string Get() /// /// Boolean indicating whether the database can be connected to. [HttpGet] + [HttpHead] [Route("/check_db")] [SwaggerOperation(Summary = "Performs a database health check", Description = "Checks if the database is reachable.")] [SwaggerResponse(200, "Database is healthy.")]