Fixed WebFinger hostnames

This commit is contained in:
Natty 2023-04-22 02:35:12 +02:00
parent 2ec0ad6068
commit bc95aa4efa
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
1 changed files with 15 additions and 7 deletions

View File

@ -40,7 +40,12 @@ pub async fn handle_webfinger(
StatusCode::UNPROCESSABLE_ENTITY StatusCode::UNPROCESSABLE_ENTITY
})?; })?;
ck.get_user_by_tag(&tag.name, tag.host.as_deref()) ck.get_user_by_tag(
&tag.name,
tag.host
.filter(|host| *host != config.networking.host)
.as_deref(),
)
.await .await
.map_err(|e| { .map_err(|e| {
error!("Data error: {e}"); error!("Data error: {e}");
@ -59,7 +64,10 @@ pub async fn handle_webfinger(
} }
let user = user.unwrap(); let user = user.unwrap();
let tag = FediverseTag::from((&user.username, user.host.as_ref())); let tag = FediverseTag::from((
&user.username,
user.host.as_ref().or(Some(&config.networking.host)),
));
let mut links = Vec::new(); let mut links = Vec::new();
let mut aliases = Vec::new(); let mut aliases = Vec::new();