mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-02-24 21:43:09 -06:00
Fail startup if well_known_client_name is configured incorrectly
This commit is contained in:
parent
6fe9d0b531
commit
55c10b52cf
|
|
@ -10,7 +10,6 @@ import (
|
||||||
"github.com/matrix-org/gomatrixserverlib"
|
"github.com/matrix-org/gomatrixserverlib"
|
||||||
"github.com/matrix-org/gomatrixserverlib/fclient"
|
"github.com/matrix-org/gomatrixserverlib/fclient"
|
||||||
"github.com/matrix-org/gomatrixserverlib/spec"
|
"github.com/matrix-org/gomatrixserverlib/spec"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"golang.org/x/crypto/ed25519"
|
"golang.org/x/crypto/ed25519"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -116,8 +115,8 @@ func (c *Global) Verify(configErrs *ConfigErrors) {
|
||||||
checkNotEmpty(configErrs, "global.private_key", string(c.PrivateKeyPath))
|
checkNotEmpty(configErrs, "global.private_key", string(c.PrivateKeyPath))
|
||||||
|
|
||||||
// Check that client well-known has a proper format
|
// Check that client well-known has a proper format
|
||||||
if c.WellKnownClientName != "" && !(strings.HasPrefix(c.WellKnownClientName, "http://") || strings.HasPrefix(c.WellKnownClientName, "https://")) {
|
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.")
|
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 {
|
for _, v := range c.VirtualHosts {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue