From 4967492f4f65ae719de9c581d04928fd2a53c958 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 26 Aug 2025 11:53:27 -0400 Subject: [PATCH] fix: handle webfinger responses with subject missing scheme --- src/activitypub/helpers.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/activitypub/helpers.js b/src/activitypub/helpers.js index a8c5532980..cc4892acb6 100644 --- a/src/activitypub/helpers.js +++ b/src/activitypub/helpers.js @@ -131,9 +131,12 @@ Helpers.query = async (id) => { ({ href: actorUri } = actorUri); } - const { subject, publicKey } = body; + let { subject, publicKey } = body; + // Fix missing scheme + if (!subject.startsWith('acct:') && !subject.startsWith('did:')) { + subject = `acct:${subject}`; + } const payload = { subject, username, hostname, actorUri, publicKey }; - const claimedId = new URL(subject).pathname; webfingerCache.set(claimedId, payload); if (claimedId !== id) {