This website works better with JavaScript.
Home
Explore
Help
Sign In
writeas
/
web-core
mirror of
https://github.com/writeas/web-core
Watch
1
Star
0
Fork
0
Code
Issues
0
Releases
0
Activity
Browse Source
Mark empty User-Agent strings as bots
master
Matt Baer
6 years ago
parent
e082f1e402
commit
5c3827dc76
1 changed files
with
3 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+3
-0
bots/bots.go
+ 3
- 0
bots/bots.go
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
}
Write
Preview
Loading…
Cancel
Save