Fixed WebFinger hostnames
This commit is contained in:
parent
2ec0ad6068
commit
bc95aa4efa
|
@ -40,12 +40,17 @@ 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(
|
||||||
.await
|
&tag.name,
|
||||||
.map_err(|e| {
|
tag.host
|
||||||
error!("Data error: {e}");
|
.filter(|host| *host != config.networking.host)
|
||||||
StatusCode::INTERNAL_SERVER_ERROR
|
.as_deref(),
|
||||||
})?
|
)
|
||||||
|
.await
|
||||||
|
.map_err(|e| {
|
||||||
|
error!("Data error: {e}");
|
||||||
|
StatusCode::INTERNAL_SERVER_ERROR
|
||||||
|
})?
|
||||||
}
|
}
|
||||||
// Kinda a
|
// Kinda a
|
||||||
WebFingerSubject::Url(url) => ck.get_user_by_uri(&url).await.map_err(|e| {
|
WebFingerSubject::Url(url) => ck.get_user_by_uri(&url).await.map_err(|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();
|
||||||
|
|
Loading…
Reference in New Issue