* control: /install/configure: validate port number

This commit is contained in:
Simon Zolin 2019-04-17 12:40:27 +03:00
parent 73fbe8b95a
commit d326d1bc8b

View File

@ -1157,6 +1157,11 @@ func handleInstallConfigure(w http.ResponseWriter, r *http.Request) {
return
}
if newSettings.Web.Port == 0 || newSettings.DNS.Port == 0 {
httpError(w, http.StatusBadRequest, "port value can't be 0")
return
}
restartHTTP := true
if config.BindHost == newSettings.Web.IP && config.BindPort == newSettings.Web.Port {
// no need to rebind