From fc79d7142be432b1319b96906e8283c8f929830b Mon Sep 17 00:00:00 2001 From: krille-chan Date: Thu, 8 May 2025 18:55:05 +0200 Subject: [PATCH] fix: Fetch well-known from domain from userId, not from homeserver domain --- lib/src/client.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/src/client.dart b/lib/src/client.dart index 47f4296d..f63e1817 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -585,7 +585,13 @@ class Client extends MatrixApi { /// The result of this call is stored in [wellKnown] for later use at runtime. @override Future getWellknown() async { - final wellKnown = await super.getWellknown(); + final wellKnownResponse = await httpClient.get( + Uri.https(userID!.domain!, '/.well-known/matrix/client'), + ); + final wellKnown = DiscoveryInformation.fromJson( + jsonDecode(utf8.decode(wellKnownResponse.bodyBytes)) + as Map, + ); // do not reset the well known here, so super call super.homeserver = wellKnown.mHomeserver.baseUrl.stripTrailingSlash();