fix: Trailing slash homeserver from wellknown

This commit is contained in:
Christian Pauly 2021-01-27 09:41:18 +01:00
parent 1178fb1868
commit d16c9eaf32
1 changed files with 7 additions and 1 deletions

View File

@ -313,7 +313,13 @@ class Client extends MatrixApi {
if (checkWellKnown) { if (checkWellKnown) {
try { try {
final wellKnown = await requestWellKnownInformations(); final wellKnown = await requestWellKnownInformations();
homeserver = Uri.parse(wellKnown.mHomeserver.baseUrl); homeserverUrl = wellKnown.mHomeserver.baseUrl.trim();
// strip a trailing slash
if (homeserverUrl.endsWith('/')) {
homeserverUrl =
homeserverUrl.substring(0, homeserverUrl.length - 1);
}
homeserver = Uri.parse(homeserverUrl);
} catch (e) { } catch (e) {
Logs().v('Found no well known information', e); Logs().v('Found no well known information', e);
} }