From f209406b3afc24b3e497403743b78eb4be8df3c1 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sun, 6 Jun 2021 12:27:04 +0200 Subject: [PATCH] Extended user agent bot criteria detection. --- .../devinsy/statoolinfos/metrics/http/HttpAccessLog.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLog.java b/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLog.java index 487349c..7462e3c 100644 --- a/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLog.java +++ b/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLog.java @@ -185,12 +185,13 @@ public class HttpAccessLog { boolean result; - if (StringsUtils.containsAnyIgnoreCase(this.userAgent.toString(), "BingPreview", "bot", "crawler", "HeadlessChrome/", "monitoring", "YisouSpider")) + if (StringsUtils.containsAnyIgnoreCase(this.userAgent.toString(), "BingPreview", "bot", "crawler", "HeadlessChrome/", " - Mobilizon ", "monitoring", "YisouSpider")) { result = true; } - else if (StringUtils.startsWithAny(this.userAgent.toString(), "Apache-HttpClient/", "Friendica ", "curl/", "git/", "github-camo", "http.rb/", "FediList ", "Go-http-client", "GoModuleMirror/", - "HotJava/", "Java/", "JGit/", "mattermost-", "Misskey/", "newspaper/", "okhttp/", "PeerTube/", "PHP/", "Pleroma ", "python-requests/", "Synapse/", "Tusky/")) + else if (StringUtils.startsWithAny(this.userAgent.toString(), "Apache-HttpClient/", "curl/", "Friendica ", "git/", "github-camo", "hackney/", "http.rb/", "FediList ", "Go-http-client", + "GoModuleMirror/", "HotJava/", "Java/", "JGit/", "MastoPeek ", "mattermost-", "Misskey/", "newspaper/", "node-fetch/", "okhttp/", "PeerTube/", "PHP/", "Pleroma ", "python-requests/", + "python/", "Python/", "Synapse/", "Tusky/")) { result = true; }