You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2025/11/26 20:03:40 UTC

(tomcat) 02/02: Drop getClientIdentifierDefault and refactor existing getClientIdentifier to use request parameter

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

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit ef1bed02b77faa395432e6d3373869bebb07c45d
Author: Brian Matzon <br...@autorola.com>
AuthorDate: Thu Sep 25 13:46:08 2025 +0200

    Drop getClientIdentifierDefault and refactor existing getClientIdentifier to use request parameter
---
 java/org/apache/catalina/valves/CrawlerSessionManagerValve.java | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
index 5c4e3a6a37..8b63297b79 100644
--- a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
+++ b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
@@ -275,14 +275,11 @@ public class CrawlerSessionManagerValve extends ValveBase {
     }
 
     private String getClientIdentifier(Request request) {
-        return getClientIdentifierDefault(request.getHost(), request.getContext(), request.getRemoteAddr());
-    }
-
-    private String getClientIdentifierDefault(Host host, Context context, String clientIp) {
-        StringBuilder result = new StringBuilder(clientIp);
+        StringBuilder result = new StringBuilder(request.getRemoteAddr());
         if (isHostAware) {
-            result.append('-').append(host.getName());
+            result.append('-').append(request.getHost().getName());
         }
+        Context context = request.getContext();
         if (isContextAware && context != null) {
             result.append(context.getName());
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org