From 68f9b6fa93b68926196832678807bf6b836c6b5a Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 5 Jun 2021 00:36:46 +0200 Subject: [PATCH] Improved bot detection code. --- src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLog.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLog.java b/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLog.java index 91f20e4..281da63 100644 --- a/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLog.java +++ b/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLog.java @@ -185,11 +185,11 @@ public class HttpAccessLog { boolean result; - if (StringsUtils.containsAnyIgnoreCase(this.userAgent.toString(), "bot", "monitoring", "Apache-HttpClient", "crawler")) + if (StringsUtils.containsAnyIgnoreCase(this.userAgent.toString(), "bot", "monitoring", "crawler")) { result = true; } - else if (StringUtils.startsWithAny(this.userAgent.toString(), "git/", "github-camo", "http.rb/", "Go-http-client", "GoModuleMirror/", "HotJava/", "Java/", "JGit/")) + else if (StringUtils.startsWithAny(this.userAgent.toString(), "Apache-HttpClient/", "git/", "github-camo", "http.rb/", "Go-http-client", "GoModuleMirror/", "HotJava/", "Java/", "JGit/")) { result = true; }