Improved bot detection code.

This commit is contained in:
Christian P. MOMON 2021-06-05 00:36:46 +02:00
parent b4b53d839a
commit 68f9b6fa93

View file

@ -185,11 +185,11 @@ public class HttpAccessLog
{ {
boolean result; boolean result;
if (StringsUtils.containsAnyIgnoreCase(this.userAgent.toString(), "bot", "monitoring", "Apache-HttpClient", "crawler")) if (StringsUtils.containsAnyIgnoreCase(this.userAgent.toString(), "bot", "monitoring", "crawler"))
{ {
result = true; 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; result = true;
} }