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) {