fix: strip acct: from webfinger if given
This commit is contained in:
parent
69f0239764
commit
5eec008343
1 changed files with 5 additions and 1 deletions
|
@ -95,7 +95,11 @@ impl<T: serde::Serialize> IntoResponse for JsonRD<T> {
|
|||
}
|
||||
|
||||
pub async fn webfinger(State(ctx): State<Context>, Query(query): Query<WebfingerQuery>) -> Result<JsonRD<JsonResourceDescriptor>, StatusCode> {
|
||||
if let Some((user, domain)) = query.resource.split_once('@') {
|
||||
if let Some((user, domain)) = query
|
||||
.resource
|
||||
.replace("acct:", "")
|
||||
.split_once('@')
|
||||
{
|
||||
let uid = ctx.uid(user.to_string());
|
||||
match model::user::Entity::find_by_id(uid)
|
||||
.one(ctx.db())
|
||||
|
|
Loading…
Reference in a new issue