Fail startup if well_known_client_name is configured incorrectly

This commit is contained in:
Till Faelligen 2023-11-25 21:37:07 +01:00
parent 6fe9d0b531
commit 55c10b52cf
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -10,7 +10,6 @@ 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"
)
@ -116,8 +115,8 @@ func (c *Global) Verify(configErrs *ConfigErrors) {
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.")
if c.WellKnownClientName != "" && !strings.HasPrefix(c.WellKnownClientName, "http://") && !strings.HasPrefix(c.WellKnownClientName, "https://") {
configErrs.Add("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 {