about summary refs log tree commit diff
path: root/LibMatrix/Services/HomeserverResolverService.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-01-11 20:14:53 +0100
committerRory& <root@rory.gay>2025-01-11 20:14:53 +0100
commit0c46901fbccb994e8ac9086536055819f2a2146b (patch)
tree79ca5271caa17a4158b83920c57741a047b66d26 /LibMatrix/Services/HomeserverResolverService.cs
parentFix up dotnet 9 and sln file (diff)
downloadLibMatrix-0c46901fbccb994e8ac9086536055819f2a2146b.tar.xz
Trim trailing slashes from well-known URIs
Diffstat (limited to 'LibMatrix/Services/HomeserverResolverService.cs')
-rw-r--r--LibMatrix/Services/HomeserverResolverService.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/LibMatrix/Services/HomeserverResolverService.cs b/LibMatrix/Services/HomeserverResolverService.cs

index f899230..d599bc6 100644 --- a/LibMatrix/Services/HomeserverResolverService.cs +++ b/LibMatrix/Services/HomeserverResolverService.cs
@@ -45,7 +45,7 @@ public class HomeserverResolverService { // try { if (client != null) - res.Client = await client ?? throw new Exception($"Could not resolve client URL for {homeserver}."); + res.Client = (await client)?.TrimEnd('/') ?? throw new Exception($"Could not resolve client URL for {homeserver}."); // } // catch (Exception e) { // _logger.LogError(e, "Error resolving client well-known for {hs}", homeserver); @@ -53,7 +53,7 @@ public class HomeserverResolverService { // try { if (server != null) - res.Server = await server ?? throw new Exception($"Could not resolve server URL for {homeserver}."); + res.Server = (await server)?.TrimEnd('/') ?? throw new Exception($"Could not resolve server URL for {homeserver}."); // } // catch (Exception e) { // _logger.LogError(e, "Error resolving server well-known for {hs}", homeserver);