Get rid of IP address sanity check.
Allow the router to return any binding errors directly. Closes #1398
This commit is contained in:
@@ -2,7 +2,6 @@ package router
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
@@ -241,12 +240,8 @@ func Start() error {
|
|||||||
port := config.WebServerPort
|
port := config.WebServerPort
|
||||||
ip := config.WebServerIP
|
ip := config.WebServerIP
|
||||||
|
|
||||||
ipAddr := net.ParseIP(ip)
|
log.Infof("Web server is listening on IP %s port %d.", ip, port)
|
||||||
if ipAddr == nil {
|
|
||||||
log.Fatalln("Invalid IP address", ip)
|
|
||||||
}
|
|
||||||
log.Infof("Web server is listening on IP %s port %d.", ipAddr.String(), port)
|
|
||||||
log.Infoln("The web admin interface is available at /admin.")
|
log.Infoln("The web admin interface is available at /admin.")
|
||||||
|
|
||||||
return http.ListenAndServe(fmt.Sprintf("%s:%d", ipAddr.String(), port), nil)
|
return http.ListenAndServe(fmt.Sprintf("%s:%d", ip, port), nil)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user