Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

Fix health status checks falling under mettric flag (#5821)

Anthony Stirlingabb8b1f72198
diff --git a/app/core/src/main/java/stirling/software/SPDF/controller/web/MetricsController.java b/app/core/src/main/java/stirling/software/SPDF/controller/web/MetricsController.java
index be50b059ea..de28d66ca9 100644
--- a/app/core/src/main/java/stirling/software/SPDF/controller/web/MetricsController.java
+++ b/app/core/src/main/java/stirling/software/SPDF/controller/web/MetricsController.java
@@ -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();