mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-03-04 02:20:19 +01:00
Fix health status checks falling under mettric flag (#5821)
This commit is contained in:
@@ -51,9 +51,19 @@ public class MetricsController {
|
||||
description =
|
||||
"This endpoint returns the status of the application and its version number.")
|
||||
public ResponseEntity<?> getStatus() {
|
||||
if (!metricsEnabled) {
|
||||
return ResponseEntity.status(HttpStatus.FORBIDDEN).body("This endpoint is disabled.");
|
||||
}
|
||||
return getApplicationStatus();
|
||||
}
|
||||
|
||||
@GetMapping("/health")
|
||||
@Operation(
|
||||
summary = "Application health check",
|
||||
description =
|
||||
"This endpoint returns the health status of the application and its version number. Mirrors /api/v1/info/status.")
|
||||
public ResponseEntity<?> getHealth() {
|
||||
return getApplicationStatus();
|
||||
}
|
||||
|
||||
private ResponseEntity<?> getApplicationStatus() {
|
||||
Map<String, String> status = new HashMap<>();
|
||||
status.put("status", "UP");
|
||||
String version = getClass().getPackage().getImplementationVersion();
|
||||
|
||||
Reference in New Issue
Block a user