Add baseline unit tests and fix home server normalization

This commit is contained in:
Foxyz committed 2026-02-20 17:45:10 +03:00
1 parent a93d619b4c
commit ce7c97d13a
6 files changed
+227 -8

No files matched your search

+8 -4
View File
@@ -397,10 +397,14 @@ String? normalizeHomeServer(String homeServerOrHost) {
return null;
}
return uri
.replace(path: '', query: null, fragment: null)
.toString()
.replaceAll(RegExp(r'/$'), '');
final normalized = Uri(
scheme: uri.scheme,
userInfo: uri.userInfo,
host: uri.host,
port: uri.hasPort ? uri.port : null,
).toString();
return normalized.replaceAll(RegExp(r'/$'), '');
}
String defaultSchemeForHost(String host) {