bugfixes #1

Merged
niklas merged 5 commits from develop into master 2021-03-21 13:25:41 +00:00
Showing only changes of commit 4394d6078d - Show all commits

View File

@ -86,12 +86,10 @@ func parseRawBlacklist(blacklist configBlacklist, raw string) []string {
// parseHostFormat parse the string in the format of a hostfile // parseHostFormat parse the string in the format of a hostfile
func parseHostFormat(raw string) []string { func parseHostFormat(raw string) []string {
finalList := make([]string, 0) finalList := make([]string, 0)
reg := regexp.MustCompile(`(?mi)^\s*(#*)\s*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+([a-zA-Z0-9\.\- ]+)$`) reg := regexp.MustCompile(`(?m)^\s*(0\.0\.0\.0) ([a-zA-Z0-9-.]*)`)
matches := reg.FindAllStringSubmatch(raw, -1) matches := reg.FindAllStringSubmatch(raw, -1)
for _, match := range matches { for _, match := range matches {
if match[1] != "#" { finalList = append(finalList, dns.Fqdn(match[2]))
finalList = append(finalList, dns.Fqdn(match[3]))
}
} }
return finalList return finalList