Skip to content

Commit

Permalink
added a warning log , for well_known_server_name,well_known_server_na…
Browse files Browse the repository at this point in the history
…me when they dont have prefix (#3205)

closing this #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>
  • Loading branch information
Mothergoose31 and S7evinK authored Nov 25, 2023
1 parent 61e5dc4 commit fd11e65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions setup/config/config_global.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion setup/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd11e65

Please sign in to comment.