diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-10-26 12:59:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-26 12:59:19 +0100 |
commit | f6dea712d2e9c71f6ebe61f90e45a142852432e8 (patch) | |
tree | 981b818ec9ece4e67f1b27ed52f82510aecc465d /clientapi/routing/directory.go | |
parent | 2a4c7f45b37a9bcd1a37d42b0668e0c3dfb29762 (diff) |
Initial support for multiple server names (#2829)
This PR is the first step towards virtual hosting by laying the
groundwork for multiple server names being configured.
Diffstat (limited to 'clientapi/routing/directory.go')
-rw-r--r-- | clientapi/routing/directory.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clientapi/routing/directory.go b/clientapi/routing/directory.go index 836d9e15..33bc63d1 100644 --- a/clientapi/routing/directory.go +++ b/clientapi/routing/directory.go @@ -75,7 +75,7 @@ func DirectoryRoom( if res.RoomID == "" { // If we don't know it locally, do a federation query. // But don't send the query to ourselves. - if domain != cfg.Matrix.ServerName { + if !cfg.Matrix.IsLocalServerName(domain) { fedRes, fedErr := federation.LookupRoomAlias(req.Context(), domain, roomAlias) if fedErr != nil { // TODO: Return 502 if the remote server errored. @@ -127,7 +127,7 @@ func SetLocalAlias( } } - if domain != cfg.Matrix.ServerName { + if !cfg.Matrix.IsLocalServerName(domain) { return util.JSONResponse{ Code: http.StatusForbidden, JSON: jsonerror.Forbidden("Alias must be on local homeserver"), |