Add baseline unit tests and fix home server normalization
This commit is contained in:
1 parent
a93d619b4c
commit
ce7c97d13a
6 files changed
+227
-8
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user