[release] version 0.4.2

This commit is contained in:
Yann Stepienik 2023-05-10 18:17:11 +01:00
parent d17aeb5a47
commit 68ef1af276
4 changed files with 10 additions and 4 deletions

View file

@ -44,7 +44,7 @@ const RestartModal = ({openModal, setOpenModal}) => {
<DialogContentText> <DialogContentText>
{warn && <div> {warn && <div>
<Alert severity="warning" icon={<WarningOutlined />}> <Alert severity="warning" icon={<WarningOutlined />}>
The server is taking longer than expected to restart.<br />Consider troubleshouting the logs. The server is taking longer than expected to restart.<br />Consider troubleshouting the logs. If you use a self-signed certificate, you might have to refresh and re-accept it.
</Alert> </Alert>
</div>} </div>}
{isRestarting ? {isRestarting ?

View file

@ -1,6 +1,6 @@
{ {
"name": "cosmos-server", "name": "cosmos-server",
"version": "0.4.1", "version": "0.4.2",
"description": "", "description": "",
"main": "test-server.js", "main": "test-server.js",
"bugs": { "bugs": {

View file

@ -92,6 +92,11 @@ func RouterGen(route utils.ProxyRouteConfig, router *mux.Router, destination htt
timeout := route.Timeout timeout := route.Timeout
if(!utils.GetMainConfig().HTTPConfig.AcceptAllInsecureHostname) {
destination = utils.EnsureHostname(destination)
}
if timeout > 0 { if timeout > 0 {
destination = utils.MiddlewareTimeout(timeout * time.Millisecond)(destination) destination = utils.MiddlewareTimeout(timeout * time.Millisecond)(destination)
} }

View file

@ -171,7 +171,7 @@ func BlockPostWithoutReferer(next http.Handler) http.Handler {
func EnsureHostname(next http.Handler) http.Handler { func EnsureHostname(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 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 og := GetMainConfig().HTTPConfig.Hostname
ni := GetMainConfig().NewInstall ni := GetMainConfig().NewInstall
@ -187,7 +187,8 @@ func EnsureHostname(next http.Handler) http.Handler {
isOk := false isOk := false
for _, hostname := range hostnames { for _, hostname := range hostnames {
if reqHostNoPort == hostname { hostnameNoPort := strings.Split(hostname, ":")[0]
if reqHostNoPort == hostnameNoPort {
isOk = true isOk = true
} }
} }