about summary refs log tree commit diff
path: root/LibMatrix/Services/HomeserverResolverService.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-08-09 21:12:11 +0200
committerRory& <root@rory.gay>2024-12-15 02:13:14 +0100
commit8130c84784cc4e696100fdda57c0d3b987ab4f80 (patch)
tree32ac670f54576168421768dd394e2c55cde04a66 /LibMatrix/Services/HomeserverResolverService.cs
parentMore synapse admin apis (diff)
downloadLibMatrix-8130c84784cc4e696100fdda57c0d3b987ab4f80.tar.xz
Minor cleanup
Diffstat (limited to 'LibMatrix/Services/HomeserverResolverService.cs')
-rw-r--r--LibMatrix/Services/HomeserverResolverService.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/LibMatrix/Services/HomeserverResolverService.cs b/LibMatrix/Services/HomeserverResolverService.cs

index f899230..dc8e047 100644 --- a/LibMatrix/Services/HomeserverResolverService.cs +++ b/LibMatrix/Services/HomeserverResolverService.cs
@@ -85,9 +85,9 @@ public class HomeserverResolverService { clientWellKnown ??= await _httpClient.TryGetFromJsonAsync<ClientWellKnown>($"http://{homeserver}/.well-known/matrix/client"); if (clientWellKnown is null) { - if (await _httpClient.CheckSuccessStatus($"https://{homeserver}/_matrix/client/versions")) + if (await MatrixHttpClient.CheckSuccessStatus($"https://{homeserver}/_matrix/client/versions")) return $"https://{homeserver}"; - if (await _httpClient.CheckSuccessStatus($"http://{homeserver}/_matrix/client/versions")) + if (await MatrixHttpClient.CheckSuccessStatus($"http://{homeserver}/_matrix/client/versions")) return $"http://{homeserver}"; } } @@ -122,16 +122,16 @@ public class HomeserverResolverService { var resolved = serverWellKnown.Homeserver; if (resolved.StartsWith("https://") || resolved.StartsWith("http://")) return resolved; - if (await _httpClient.CheckSuccessStatus($"https://{resolved}/_matrix/federation/v1/version")) + if (await MatrixHttpClient.CheckSuccessStatus($"https://{resolved}/_matrix/federation/v1/version")) return $"https://{resolved}"; - if (await _httpClient.CheckSuccessStatus($"http://{resolved}/_matrix/federation/v1/version")) + if (await MatrixHttpClient.CheckSuccessStatus($"http://{resolved}/_matrix/federation/v1/version")) return $"http://{resolved}"; _logger.LogWarning("Server well-known points to invalid server: {resolved}", resolved); } // fallback: most servers host C2S and S2S on the same domain var clientUrl = await _tryResolveClientEndpoint(homeserver); - if (clientUrl is not null && await _httpClient.CheckSuccessStatus($"{clientUrl}/_matrix/federation/v1/version")) + if (clientUrl is not null && await MatrixHttpClient.CheckSuccessStatus($"{clientUrl}/_matrix/federation/v1/version")) return clientUrl; _logger.LogInformation("No server well-known for {server}...", homeserver);