本網站在啟用 JavaScript 的情況下可以運作的更好。
首頁
探索
說明
登入
writeas
/
web-core
镜像来自
https://github.com/writeas/web-core
關注
1
收藏
0
複製
0
程式碼
問題
0
版本發佈
0
活動
瀏覽代碼
Mark empty User-Agent strings as bots
master
Matt Baer
6 年之前
父節點
e082f1e402
當前提交
5c3827dc76
共有
1 個檔案被更改
,包括
3 行新增
和
0 行删除
分割檢視
Diff Options
Show Stats
Download Patch File
Download Diff File
+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
}
Write
Preview
Loading…
取消
儲存