Main: Be a little more resilient againts .well-known delegation not resolving
This commit is contained in:
parent
af2baa5089
commit
95d6e155c8
1 changed files with 4 additions and 1 deletions
|
@ -84,7 +84,10 @@ async fn process_media(source: MediaSource, body: Option<String>, server: Option
|
||||||
|
|
||||||
let client = match server {
|
let client = match server {
|
||||||
Some(ref url) => Client::builder().server_name_or_homeserver_url(url),
|
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?;
|
}.build().await?;
|
||||||
|
|
||||||
debug!("Downloading {} from {}", uri, client.homeserver());
|
debug!("Downloading {} from {}", uri, client.homeserver());
|
||||||
|
|
Loading…
Reference in a new issue