mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 06:53:09 -06:00
Update prefix checking
This commit is contained in:
parent
56fbe9d62b
commit
b35a44c19d
|
|
@ -129,10 +129,6 @@ 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{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
|
@ -124,10 +123,6 @@ 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
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import (
|
|||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/gomatrixserverlib/fclient"
|
||||
"github.com/matrix-org/gomatrixserverlib/spec"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/crypto/ed25519"
|
||||
)
|
||||
|
||||
|
|
@ -114,6 +115,11 @@ func (c *Global) Verify(configErrs *ConfigErrors) {
|
|||
checkNotEmpty(configErrs, "global.server_name", string(c.ServerName))
|
||||
checkNotEmpty(configErrs, "global.private_key", string(c.PrivateKeyPath))
|
||||
|
||||
// Check that client well-known has a proper format
|
||||
if c.WellKnownClientName != "" && !(strings.HasPrefix(c.WellKnownClientName, "http://") || strings.HasPrefix(c.WellKnownClientName, "https://")) {
|
||||
logrus.Warn("The configuration for well_known_client_name does not have a proper format, consider adding http:// or https://. Some clients may fail to connect.")
|
||||
}
|
||||
|
||||
for _, v := range c.VirtualHosts {
|
||||
v.Verify(configErrs)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue