fix: #13352, also do the webfinger backreference check when calling assertGroup

This commit is contained in:
Julian Lam
2025-04-29 11:18:24 -04:00
parent e9b3306e79
commit 2572cbf5d5

View File

@@ -305,6 +305,13 @@ Actors.assertGroup = async (ids, options = {}) => {
activitypub.helpers.log(`[activitypub/actors] Processing group ${id}`);
const actor = (typeof id === 'object' && id.hasOwnProperty('id')) ? id : await activitypub.get('uid', 0, id, { cache: process.env.CI === 'true' });
// webfinger backreference check
const { hostname: domain } = new URL(id);
const { actorUri: canonicalId } = await activitypub.helpers.query(`${actor.preferredUsername}@${domain}`);
if (id !== canonicalId) {
return null;
}
const typeOk = Array.isArray(actor.type) ?
actor.type.some(type => activitypub._constants.acceptableGroupTypes.has(type)) :
activitypub._constants.acceptableGroupTypes.has(actor.type);