fix(8201): restore old behavior forward plugin continue on empty conf file (#8203)

This commit is contained in:
Antoine
2026-07-02 08:11:37 +02:00
committed by GitHub
parent 8d94712f99
commit 3a4b87bdb4
4 changed files with 34 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
package forward
import (
"errors"
"fmt"
"net"
"strings"
@@ -39,9 +40,14 @@ func classifyToAddrs(toAddrs []string) ([]toEntry, error) {
continue
}
// Empty file are skip
if errors.Is(parseErr, parse.ErrNoNameservers) {
continue
}
// Only fall through to hostname parsing if the error specifically
// indicates the address is not an IP or file. Other errors (like
// "no nameservers found" from file parsing) should be propagated.
// "invalid address" from ip parsing) should be propagated.
if !strings.Contains(parseErr.Error(), "not an IP address or file") {
return nil, parseErr
}