aboutsummaryrefslogtreecommitdiff
path: root/clientapi/userutil
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-11-18 13:24:02 +0000
committerNeil Alexander <neilalexander@users.noreply.github.com>2022-11-18 13:24:02 +0000
commit8299da590542a982437ad9dd30115d23c3d9d075 (patch)
treee24ba6d33e4f551252150d42bcb43e1587e0aaec /clientapi/userutil
parenta8e7ffc7ab147ebced766da8e0e1ebb1d75f846a (diff)
Fix registration for virtual hosting
Diffstat (limited to 'clientapi/userutil')
-rw-r--r--clientapi/userutil/userutil_test.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/clientapi/userutil/userutil_test.go b/clientapi/userutil/userutil_test.go
index ccd6647b..ee6bf8a0 100644
--- a/clientapi/userutil/userutil_test.go
+++ b/clientapi/userutil/userutil_test.go
@@ -30,7 +30,9 @@ var (
// TestGoodUserID checks that correct localpart is returned for a valid user ID.
func TestGoodUserID(t *testing.T) {
cfg := &config.Global{
- ServerName: serverName,
+ SigningIdentity: gomatrixserverlib.SigningIdentity{
+ ServerName: serverName,
+ },
}
lp, _, err := ParseUsernameParam(goodUserID, cfg)
@@ -47,7 +49,9 @@ func TestGoodUserID(t *testing.T) {
// TestWithLocalpartOnly checks that localpart is returned when usernameParam contains only localpart.
func TestWithLocalpartOnly(t *testing.T) {
cfg := &config.Global{
- ServerName: serverName,
+ SigningIdentity: gomatrixserverlib.SigningIdentity{
+ ServerName: serverName,
+ },
}
lp, _, err := ParseUsernameParam(localpart, cfg)
@@ -64,7 +68,9 @@ func TestWithLocalpartOnly(t *testing.T) {
// TestIncorrectDomain checks for error when there's server name mismatch.
func TestIncorrectDomain(t *testing.T) {
cfg := &config.Global{
- ServerName: invalidServerName,
+ SigningIdentity: gomatrixserverlib.SigningIdentity{
+ ServerName: invalidServerName,
+ },
}
_, _, err := ParseUsernameParam(goodUserID, cfg)
@@ -77,7 +83,9 @@ func TestIncorrectDomain(t *testing.T) {
// TestBadUserID checks that ParseUsernameParam fails for invalid user ID
func TestBadUserID(t *testing.T) {
cfg := &config.Global{
- ServerName: serverName,
+ SigningIdentity: gomatrixserverlib.SigningIdentity{
+ ServerName: serverName,
+ },
}
_, _, err := ParseUsernameParam(badUserID, cfg)