This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 02cb461652 Fix test
02cb461652 is described below
commit 02cb4616521a27cd02068cc3c22f54badbebb25e
Author: remm <[email protected]>
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 c06fcef87f..b21d8b083f 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: [email protected]
For additional commands, e-mail: [email protected]