mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 21:31:36 +02:00
Handle trailing slash on status and health_check
This commit is contained in:
@@ -28,7 +28,11 @@ public class HealthCheckHandler extends AbstractHandler {
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response
|
||||
) throws IOException {
|
||||
if ("GET".equals(baseRequest.getMethod()) && "/health_check".equals(target)) {
|
||||
if (
|
||||
"GET".equals(baseRequest.getMethod())
|
||||
&& target != null
|
||||
&& target.matches("^\\/health_check\\/?$")
|
||||
) {
|
||||
Log.info("GET <- /health_check");
|
||||
baseRequest.setHandled(true);
|
||||
response.setContentType("text/plain");
|
||||
|
||||
@@ -28,7 +28,11 @@ public class StatusHandler extends AbstractHandler {
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response
|
||||
) throws IOException {
|
||||
if ("GET".equals(baseRequest.getMethod()) && "/status".equals(target)) {
|
||||
if (
|
||||
"GET".equals(baseRequest.getMethod())
|
||||
&& target != null
|
||||
&& target.matches("^\\/status\\/?$")
|
||||
) {
|
||||
Log.info("GET <- /status");
|
||||
baseRequest.setHandled(true);
|
||||
response.setContentType("text/plain");
|
||||
|
||||
Reference in New Issue
Block a user