Mark empty User-Agent strings as bots

This commit is contained in:
Matt Baer
2017-09-28 17:20:32 -04:00
parent e082f1e402
commit 5c3827dc76
+3
View File
@@ -225,6 +225,9 @@ var botPrefixes = []string{
// IsBot returns whether or not the provided User-Agent string is a known bot
// or crawler.
func IsBot(ua string) bool {
if ua == "" {
return true
}
if _, ok := bots[ua]; ok {
return true
}