Merge branch 'ChristianPauly-master-patch-89224' into 'master'
Fix wellknown with trailing slash See merge request famedly/famedlysdk!369
This commit is contained in:
commit
01daa3ec44
|
@ -214,8 +214,11 @@ class MatrixApi {
|
||||||
/// Gets discovery information about the domain. The file may include additional keys.
|
/// Gets discovery information about the domain. The file may include additional keys.
|
||||||
/// https://matrix.org/docs/spec/client_server/r0.6.0#get-well-known-matrix-client
|
/// https://matrix.org/docs/spec/client_server/r0.6.0#get-well-known-matrix-client
|
||||||
Future<WellKnownInformations> requestWellKnownInformations() async {
|
Future<WellKnownInformations> requestWellKnownInformations() async {
|
||||||
final response = await httpClient
|
var baseUrl = homeserver.toString();
|
||||||
.get('${homeserver.toString()}/.well-known/matrix/client');
|
if (baseUrl.endsWith('/')) {
|
||||||
|
baseUrl = baseUrl.substring(0, baseUrl.length - 1);
|
||||||
|
}
|
||||||
|
final response = await httpClient.get('$baseUrl/.well-known/matrix/client');
|
||||||
final rawJson = json.decode(response.body);
|
final rawJson = json.decode(response.body);
|
||||||
return WellKnownInformations.fromJson(rawJson);
|
return WellKnownInformations.fromJson(rawJson);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue