aboutsummaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
authorJoseph Alvarenga Beech <44758505+Mothergoose31@users.noreply.github.com>2023-11-25 13:19:22 -0800
committerGitHub <noreply@github.com>2023-11-25 22:19:22 +0100
commitfd11e65a9d113839177f9f7a32af328a0292b195 (patch)
tree857845db0e90c8620259c43103d01b7f0e956302 /setup
parent61e5dc47d7525b60e749d77618dc5b66848dac90 (diff)
added a warning log , for well_known_server_name,well_known_server_name when they dont have prefix (#3205)
closing this https://github.com/matrix-org/dendrite/issues/3180 added a warning log when either well_known_server_name, well_known_server_name: dont have a prefix in them josephalvarengabeech@pm.me --------- Co-authored-by: Till Faelligen <2353100+S7evinK@users.noreply.github.com>
Diffstat (limited to 'setup')
-rw-r--r--setup/config/config_global.go5
-rw-r--r--setup/config/config_test.go2
2 files changed, 6 insertions, 1 deletions
diff --git a/setup/config/config_global.go b/setup/config/config_global.go
index 5b4ccf40..3234dadb 100644
--- a/setup/config/config_global.go
+++ b/setup/config/config_global.go
@@ -114,6 +114,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://") {
+ 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 {
v.Verify(configErrs)
}
diff --git a/setup/config/config_test.go b/setup/config/config_test.go
index 8a65c990..eeefb425 100644
--- a/setup/config/config_test.go
+++ b/setup/config/config_test.go
@@ -54,7 +54,7 @@ global:
key_id: ed25519:auto
key_validity_period: 168h0m0s
well_known_server_name: "localhost:443"
- well_known_client_name: "localhost:443"
+ well_known_client_name: "https://localhost"
trusted_third_party_id_servers:
- matrix.org
- vector.im