Disallow frontends without any listening address

This commit is contained in:
Simon Ser 2022-06-25 11:46:14 +02:00
parent d1812162a8
commit 9a879327c3
1 changed files with 4 additions and 0 deletions

View File

@ -64,6 +64,10 @@ func parseFrontend(srv *Server, d *scfg.Directive) error {
addresses = append(addresses, listenDirective.Params...) addresses = append(addresses, listenDirective.Params...)
} }
if len(addresses) == 0 {
return fmt.Errorf("missing listening addresses in frontend block")
}
for _, addr := range addresses { for _, addr := range addresses {
host, port, err := net.SplitHostPort(addr) host, port, err := net.SplitHostPort(addr)
if err != nil { if err != nil {