From 95d6e155c890308f508c93d2ac09a293c2dcc313 Mon Sep 17 00:00:00 2001 From: networkException Date: Fri, 23 Aug 2024 01:23:07 +0200 Subject: [PATCH] Main: Be a little more resilient againts .well-known delegation not resolving --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index e067815..90f0eda 100644 --- a/src/main.rs +++ b/src/main.rs @@ -84,7 +84,10 @@ async fn process_media(source: MediaSource, body: Option, server: Option let client = match server { Some(ref url) => Client::builder().server_name_or_homeserver_url(url), - None => Client::builder().server_name(server_name), + // NOTE: We know that server_name is not a URL at this point, however if resolving .well-known + // delegation fails falling back to interpreting the server name as the base URL is somewhat + // more resilient. Just had this now. + None => Client::builder().server_name_or_homeserver_url(server_name), }.build().await?; debug!("Downloading {} from {}", uri, client.homeserver());