From c741797472ed58d3890cd03c31f415407f6b1230 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 31 Aug 2020 20:36:52 -0700 Subject: [PATCH] Force Applebot to be seen as a scraping bot. Closes #134 --- utils/utils.go | 1 + utils/utils_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/utils/utils.go b/utils/utils.go index 928abd81b..8e1dcd15a 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -53,6 +53,7 @@ func IsUserAgentABot(userAgent string) bool { botStrings := []string{ "mastodon", "pleroma", + "applebot", } for _, botString := range botStrings { diff --git a/utils/utils_test.go b/utils/utils_test.go index bb25c5ba7..dfa204848 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -6,6 +6,7 @@ func TestUserAgent(t *testing.T) { testAgents := []string{ "Pleroma 1.0.0-1168-ge18c7866-pleroma-dot-site; https://pleroma.site info@pleroma.site", "Mastodon 1.2.3 Bot", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15 (Applebot/0.1; +http://www.apple.com/go/applebot)", } for _, agent := range testAgents {