fix(kubernetes): panic on empty ListenHosts (#7857)

This commit is contained in:
Ville Vesilehto
2026-02-16 17:04:19 +02:00
committed by GitHub
parent 7767dc0e3a
commit 23774edfa4
2 changed files with 37 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ import (
func boundIPs(c *caddy.Controller) (ips []net.IP) {
conf := dnsserver.GetConfig(c)
hosts := conf.ListenHosts
if hosts == nil || hosts[0] == "" {
if len(hosts) == 0 || hosts[0] == "" {
hosts = nil
addrs, err := net.InterfaceAddrs()
if err != nil {