Correctly format ipv6 resolver config for lua

Fixes #3881
This commit is contained in:
Thomas Jackson 2019-03-09 16:39:25 -08:00
parent 2dbc1ea3b3
commit eba4a8b87c
2 changed files with 8 additions and 4 deletions

View file

@ -250,10 +250,14 @@ func buildResolversForLua(res interface{}, disableIpv6 interface{}) string {
r := []string{}
for _, ns := range nss {
if ing_net.IsIPV6(ns) && no6 {
continue
if ing_net.IsIPV6(ns) {
if no6 {
continue
}
r = append(r, fmt.Sprintf("\"[%v]\"", ns))
} else {
r = append(r, fmt.Sprintf("\"%v\"", ns))
}
r = append(r, fmt.Sprintf("\"%v\"", ns))
}
return strings.Join(r, ", ")