mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #13352, also do the webfinger backreference check when calling assertGroup
This commit is contained in:
@@ -305,6 +305,13 @@ Actors.assertGroup = async (ids, options = {}) => {
|
|||||||
activitypub.helpers.log(`[activitypub/actors] Processing group ${id}`);
|
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' });
|
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) ?
|
const typeOk = Array.isArray(actor.type) ?
|
||||||
actor.type.some(type => activitypub._constants.acceptableGroupTypes.has(type)) :
|
actor.type.some(type => activitypub._constants.acceptableGroupTypes.has(type)) :
|
||||||
activitypub._constants.acceptableGroupTypes.has(actor.type);
|
activitypub._constants.acceptableGroupTypes.has(actor.type);
|
||||||
|
|||||||
Reference in New Issue
Block a user