Explorar el Código

bug【6103】日志一直出现/health 404 = Not Found 等提示问题(处理端点暴漏安全问题后出现该情况)

ZhuJiaHao hace 6 meses
padre
commit
4e3b8a6179

+ 5 - 0
ibps-basic-root/modules/basic-response/src/main/java/com/lc/ibps/cloud/controller/ResponseErrorController.java

@@ -32,6 +32,11 @@ public class ResponseErrorController implements ErrorController {
         return "/error";
     }
 
+    @RequestMapping(value = "/health")
+    public String health() {
+        return "{\"status\":\"UP\"}";
+    }
+    
     @RequestMapping(value = "/error")
 	public void error(HttpServletRequest request, HttpServletResponse response) throws IOException {
     	if(response.isCommitted()) {

+ 1 - 1
ibps-basic-root/modules/basic-response/src/main/resources/config/application-common.yml

@@ -88,7 +88,7 @@ management:
     web:
       base-path: /
       exposure:
-        include: ""
+        include: "health"
         exclude: "*"
   metrics:
     tags: