Skip to content

Commit

Permalink
Add hint to accept HTTP HEAD on health routes (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrizzlyOwl authored Oct 15, 2024
1 parent e49e7dd commit a9625e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions TramsDataApi/Controllers/HealthCheckController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public HealthCheckController(LegacyTramsDbContext context, ILogger<HealthCheckCo
/// </summary>
/// <returns>String message indicating health status.</returns>
[HttpGet]
[HttpHead]
[SwaggerOperation(Summary = "Performs a basic health check", Description = "Checks if the API is operational.")]
[SwaggerResponse(200, "API is healthy.")]
public string Get()
Expand All @@ -48,6 +49,7 @@ public string Get()
/// </summary>
/// <returns>Boolean indicating whether the database can be connected to.</returns>
[HttpGet]
[HttpHead]
[Route("/check_db")]
[SwaggerOperation(Summary = "Performs a database health check", Description = "Checks if the database is reachable.")]
[SwaggerResponse(200, "Database is healthy.")]
Expand Down

0 comments on commit a9625e8

Please sign in to comment.