From 9e9e9fbef9b7ba503aab971c00fe542975264e72 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Tue, 6 Dec 2022 12:19:18 +0000 Subject: [PATCH] check still for empty string --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 3960c88..c916e54 100644 --- a/main.go +++ b/main.go @@ -299,7 +299,7 @@ func listen(handler http.Handler) { var s4, s6, sSocket *http.Server // IPv4 - if config.Server.ListenIpV4 != "-" { + if config.Server.ListenIpV4 != "-" && config.Server.ListenIpV4 != "" { bindString4 := config.Server.ListenIpV4 + ":" + strconv.Itoa(config.Server.Port) s4 = &http.Server{ Handler: handler, @@ -310,7 +310,7 @@ func listen(handler http.Handler) { } // IPv6 - if config.Server.ListenIpV6 != "-" { + if config.Server.ListenIpV6 != "-" && config.Server.ListenIpV6 != "" { bindString6 := "[" + config.Server.ListenIpV6 + "]:" + strconv.Itoa(config.Server.Port) s6 = &http.Server{ Handler: handler,