This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new ec2f2f2b6a Fix test
ec2f2f2b6a is described below

commit ec2f2f2b6a463e30fc5a2290fdee9950344130cf
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

Reply via email to