This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new c46c37649e Fix test c46c37649e is described below commit c46c37649e2d086ccc67f1236b2856305f2a03ce Author: remm <r...@apache.org> AuthorDate: Thu Oct 10 17:59:52 2024 +0200 Fix test Also context already had a NPE check. --- java/org/apache/catalina/valves/CrawlerSessionManagerValve.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java index 932995a07d..7bcb863111 100644 --- a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java +++ b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java @@ -175,7 +175,8 @@ public class CrawlerSessionManagerValve extends ValveBase { @Override public void invoke(Request request, Response response) throws IOException, ServletException { - if (request.getHost() == null || request.getContext() == null) { + Host host = request.getHost(); + if (host == null) { // Request will have no session getNext().invoke(request, response); return; @@ -184,7 +185,7 @@ public class CrawlerSessionManagerValve extends ValveBase { boolean isBot = false; String sessionId = null; String clientIp = request.getRemoteAddr(); - String clientIdentifier = getClientIdentifier(request.getHost(), request.getContext(), clientIp); + String clientIdentifier = getClientIdentifier(host, request.getContext(), clientIp); if (log.isTraceEnabled()) { log.trace(request.hashCode() + ": ClientIdentifier=" + clientIdentifier + ", RequestedSessionId=" + --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org