Merge branch 'krille/checkHomeserver' into 'main'
fix: Trailing slash homeserver from wellknown See merge request famedly/famedlysdk!627
This commit is contained in:
commit
7214662770
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue