mirror of
https://github.com/coredns/coredns.git
synced 2026-07-10 17:50:12 -04:00
fix(8201): restore old behavior forward plugin continue on empty conf file (#8203)
This commit is contained in:
@@ -54,7 +54,7 @@ func HostPortOrFile(s ...string) ([]string, error) {
|
||||
servers = append(servers, ss...)
|
||||
continue
|
||||
}
|
||||
return servers, fmt.Errorf("not an IP address or file: %q", host)
|
||||
return servers, fmt.Errorf("not an IP address or file %q: %w", host, err)
|
||||
}
|
||||
var ss string
|
||||
switch trans {
|
||||
@@ -79,7 +79,7 @@ func HostPortOrFile(s ...string) ([]string, error) {
|
||||
servers = append(servers, ss...)
|
||||
continue
|
||||
}
|
||||
return servers, fmt.Errorf("not an IP address or file: %q", host)
|
||||
return servers, fmt.Errorf("not an IP address or file %q: %w", host, err)
|
||||
}
|
||||
servers = append(servers, h)
|
||||
}
|
||||
@@ -92,13 +92,13 @@ func HostPortOrFile(s ...string) ([]string, error) {
|
||||
// Try to open this is a file first.
|
||||
func tryFile(s string) ([]string, error) {
|
||||
c, err := dns.ClientConfigFromFile(s)
|
||||
if err == os.ErrNotExist {
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
return nil, fmt.Errorf("failed to open file %q: %q", s, err)
|
||||
} else if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
servers := []string{}
|
||||
var servers []string
|
||||
for _, s := range c.Servers {
|
||||
servers = append(servers, net.JoinHostPort(stripZone(s), c.Port))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user