瀏覽代碼

Mark empty User-Agent strings as bots

master
Matt Baer 6 年之前
父節點
當前提交
5c3827dc76
共有 1 個檔案被更改,包括 3 行新增0 行删除
  1. +3
    -0
      bots/bots.go

+ 3
- 0
bots/bots.go 查看文件

@@ -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
}


Loading…
取消
儲存