cant remove, need to rebuild.... grr

This commit is contained in:
Hyatt 2022-03-21 18:05:14 -05:00
parent fbbc922b04
commit a1108c9ec4
Signed by: nhyatt
GPG Key ID: C50D0BBB5BC40BEA

View File

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