Add robots.txt checking
Still needs periodic cache refresh
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
package gemini
|
||||
|
||||
import "gemini-grc/logging"
|
||||
|
||||
var Blacklist *[]string
|
||||
|
||||
func InBlacklist(s *Snapshot) bool {
|
||||
if Blacklist == nil {
|
||||
data := ReadLines("blacklists/domains.txt")
|
||||
Blacklist = &data
|
||||
logging.LogInfo("Loaded %d blacklisted domains", len(*Blacklist))
|
||||
}
|
||||
for _, l := range *Blacklist {
|
||||
if s.Host == l {
|
||||
return true
|
||||
}
|
||||
// if strings.HasPrefix(s.URL.String(), l) {
|
||||
// return true
|
||||
// }
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user