Add our own botlist for user-agent matching. Closes #51

This commit is contained in:
Gabe Kangas
2020-07-13 19:07:30 -07:00
parent 46b3922e1d
commit ab21706d73
3 changed files with 40 additions and 4 deletions
+16
View File
@@ -0,0 +1,16 @@
package utils
import "testing"
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",
}
for _, agent := range testAgents {
if !IsUserAgentABot(agent) {
t.Error("Incorrect parsing of useragent", agent)
}
}
}