From 4164ab782bee84a1b1324ef0bc037b9f2a0710f0 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Mon, 2 Sep 2024 12:01:02 +1000 Subject: [PATCH] PR #12208 - changes from review Signed-off-by: Lachlan Roberts --- .../jetty/ee10/servlet/ServletContextHandler.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletContextHandler.java b/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletContextHandler.java index 3014288fb91..c7f07432d53 100644 --- a/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletContextHandler.java +++ b/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletContextHandler.java @@ -62,7 +62,6 @@ import jakarta.servlet.descriptor.JspPropertyGroupDescriptor; import jakarta.servlet.descriptor.TaglibDescriptor; import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpSessionActivationListener; import jakarta.servlet.http.HttpSessionAttributeListener; import jakarta.servlet.http.HttpSessionBindingListener; @@ -1191,13 +1190,9 @@ public class ServletContextHandler extends ContextHandler protected boolean handleByContextHandler(String pathInContext, ContextRequest request, Response response, Callback callback) { boolean initialDispatch = request instanceof ServletContextRequest; - if (initialDispatch && isProtectedTarget(pathInContext)) - { - Response.writeError(request, response, callback, HttpServletResponse.SC_NOT_FOUND, null); - return true; - } - - return false; + if (!initialDispatch) + return false; + return super.handleByContextHandler(pathInContext, request, response, callback); } @Override