Mark empty User-Agent strings as bots
This commit is contained in:
@@ -225,6 +225,9 @@ var botPrefixes = []string{
|
|||||||
// IsBot returns whether or not the provided User-Agent string is a known bot
|
// IsBot returns whether or not the provided User-Agent string is a known bot
|
||||||
// or crawler.
|
// or crawler.
|
||||||
func IsBot(ua string) bool {
|
func IsBot(ua string) bool {
|
||||||
|
if ua == "" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
if _, ok := bots[ua]; ok {
|
if _, ok := bots[ua]; ok {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user