From 5eec008343ff5dba6415d942e6ab9a3e97686675 Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 22 Mar 2024 01:22:03 +0100 Subject: [PATCH] fix: strip acct: from webfinger if given --- src/activitypub/well_known.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/activitypub/well_known.rs b/src/activitypub/well_known.rs index c098aa78..36abcca9 100644 --- a/src/activitypub/well_known.rs +++ b/src/activitypub/well_known.rs @@ -95,7 +95,11 @@ impl IntoResponse for JsonRD { } pub async fn webfinger(State(ctx): State, Query(query): Query) -> Result, 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())