[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>
{warn && <div>
<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>
</div>}
{isRestarting ?

View file

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

View file

@ -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)
}

View file

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