diff --git a/client/src/pages/config/users/restart.jsx b/client/src/pages/config/users/restart.jsx index 1da8e78..757e7b6 100644 --- a/client/src/pages/config/users/restart.jsx +++ b/client/src/pages/config/users/restart.jsx @@ -44,7 +44,7 @@ const RestartModal = ({openModal, setOpenModal}) => { {warn &&
}> - The server is taking longer than expected to restart.
Consider troubleshouting the logs. + The server is taking longer than expected to restart.
Consider troubleshouting the logs. If you use a self-signed certificate, you might have to refresh and re-accept it.
} {isRestarting ? diff --git a/package.json b/package.json index ffa1980..9307cf4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.4.1", + "version": "0.4.2", "description": "", "main": "test-server.js", "bugs": { diff --git a/src/proxy/routerGen.go b/src/proxy/routerGen.go index a933659..7ce306c 100644 --- a/src/proxy/routerGen.go +++ b/src/proxy/routerGen.go @@ -92,6 +92,11 @@ func RouterGen(route utils.ProxyRouteConfig, router *mux.Router, destination htt timeout := route.Timeout + + if(!utils.GetMainConfig().HTTPConfig.AcceptAllInsecureHostname) { + destination = utils.EnsureHostname(destination) + } + if timeout > 0 { destination = utils.MiddlewareTimeout(timeout * time.Millisecond)(destination) } diff --git a/src/utils/middleware.go b/src/utils/middleware.go index c38fdf1..ab88e3f 100644 --- a/src/utils/middleware.go +++ b/src/utils/middleware.go @@ -171,7 +171,7 @@ func BlockPostWithoutReferer(next http.Handler) http.Handler { func EnsureHostname(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - Debug("Request requested resource from : " + r.Host) + Debug("Ensuring origin for requested resource from : " + r.Host) og := GetMainConfig().HTTPConfig.Hostname ni := GetMainConfig().NewInstall @@ -187,7 +187,8 @@ func EnsureHostname(next http.Handler) http.Handler { isOk := false for _, hostname := range hostnames { - if reqHostNoPort == hostname { + hostnameNoPort := strings.Split(hostname, ":")[0] + if reqHostNoPort == hostnameNoPort { isOk = true } }