diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2021-08-27 16:50:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-27 16:50:30 +0100 |
commit | 51b119107c972007f5a1bc626758a6229ece14db (patch) | |
tree | 5a19d194f2ab3c664195bf50d0c7286a705aae85 /federationapi/routing | |
parent | 2dd5fd1fd676c570a13c2ed062fa47a026ca826f (diff) |
Don't return nonsense canonical room aliases in the public rooms responses (#1992)
Diffstat (limited to 'federationapi/routing')
-rw-r--r-- | federationapi/routing/publicrooms.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/federationapi/routing/publicrooms.go b/federationapi/routing/publicrooms.go index ddd92c5c..5b9be880 100644 --- a/federationapi/routing/publicrooms.go +++ b/federationapi/routing/publicrooms.go @@ -156,7 +156,9 @@ func fillInRooms(ctx context.Context, roomIDs []string, rsAPI roomserverAPI.Room case topicTuple: pub.Topic = contentVal case canonicalTuple: - pub.CanonicalAlias = contentVal + if _, _, err := gomatrixserverlib.SplitID('#', contentVal); err == nil { + pub.CanonicalAlias = contentVal + } case visibilityTuple: pub.WorldReadable = contentVal == "world_readable" // need both of these to determine whether guests can join |