check still for empty string

This commit is contained in:
Soner Sayakci 2022-12-06 12:19:18 +00:00
parent 0a2cba647c
commit 9e9e9fbef9
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -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,