cant remove, need to rebuild.... grr
This commit is contained in:
parent
fbbc922b04
commit
a1108c9ec4
@ -40,7 +40,9 @@ func cleanBadDomains(domains []string) []string {
|
||||
|
||||
for i, allowedItem := range config.Config.AllowLists {
|
||||
log.Printf("[DEBUG] Processing %d of %d\n", i+1, len(config.Config.AllowLists))
|
||||
for k, v := range domains {
|
||||
|
||||
list = []string{}
|
||||
for _, v := range domains {
|
||||
r, err := regexp.Compile(allowedItem)
|
||||
if err != nil {
|
||||
log.Printf("[ERROR] Allow list item (%s) is not valid regex: %v\n", allowedItem, err)
|
||||
@ -48,9 +50,11 @@ func cleanBadDomains(domains []string) []string {
|
||||
}
|
||||
if r.MatchString(v) {
|
||||
log.Printf("[DEBUG] Removing allowed matching item: %s\n", v)
|
||||
domains = removeStringFromSlice(domains, k)
|
||||
} else {
|
||||
list = append(list, v)
|
||||
}
|
||||
}
|
||||
domains = list
|
||||
}
|
||||
log.Printf("[INFO] Allowed hosts removed: %d\n", total-len(domains))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user