1
0
Fork 0
mirror of https://github.com/matrix-org/dendrite.git synced 2025-03-28 04:24:28 -05:00

Added Warning Log when either Well_known_client or well known server dont have http || https prefix

This commit is contained in:
unknown 2023-09-24 20:48:44 -07:00
parent db83789654
commit c991278e45
2 changed files with 9 additions and 0 deletions
clientapi/routing
federationapi/routing

View file

@ -129,6 +129,10 @@ func Setup(
})).Methods(http.MethodGet, http.MethodOptions)
}
if !strings.HasPrefix(string(cfg.Matrix.ServerName), "http://") && !strings.HasPrefix(string(cfg.Matrix.ServerName), "https://") {
logrus.Warn("The well_known_server_name does not start with http:// or https:// does not start with 'http://' or 'https://'. Some clients may fail to connect.")
}
publicAPIMux.Handle("/versions",
httputil.MakeExternalAPI("versions", func(req *http.Request) util.JSONResponse {
return util.JSONResponse{

View file

@ -18,6 +18,7 @@ import (
"context"
"fmt"
"net/http"
"strings"
"sync"
"time"
@ -123,6 +124,10 @@ func Setup(
).Methods(http.MethodGet, http.MethodOptions)
}
if !strings.HasPrefix(string(cfg.Matrix.ServerName), "http://") && !strings.HasPrefix(string(cfg.Matrix.ServerName), "https://") {
logrus.Warn("The well_known_server_name does not start with http:// or https:// does not start with 'http://' or 'https://'. Some clients may fail to connect.")
}
// Ignore the {keyID} argument as we only have a single server key so we always
// return that key.
// Even if we had more than one server key, we would probably still ignore the