summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-06-18 10:37:30 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-06-18 10:37:30 -0400
commit82b90d02ae965a08f747fae96c9f087c707d1435 (patch)
treed2ac92a97300b17b3612dd87072ad6d010031dff
parentfilter boosts out of pinned notes when federating (diff)
downloadsharkey-82b90d02ae965a08f747fae96c9f087c707d1435.tar.gz
sharkey-82b90d02ae965a08f747fae96c9f087c707d1435.tar.bz2
sharkey-82b90d02ae965a08f747fae96c9f087c707d1435.zip
don't allow boosts to be fetched as a note over AP
-rw-r--r--packages/backend/src/server/ActivityPubServerService.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/backend/src/server/ActivityPubServerService.ts b/packages/backend/src/server/ActivityPubServerService.ts
index a4ac2375c0..27d25d2152 100644
--- a/packages/backend/src/server/ActivityPubServerService.ts
+++ b/packages/backend/src/server/ActivityPubServerService.ts
@@ -33,7 +33,7 @@ import type Logger from '@/logger.js';
import { LoggerService } from '@/core/LoggerService.js';
import { bindThis } from '@/decorators.js';
import { IActivity, IAnnounce, ICreate } from '@/core/activitypub/type.js';
-import { isQuote, isRenote } from '@/misc/is-renote.js';
+import { isPureRenote, isQuote, isRenote } from '@/misc/is-renote.js';
import * as Acct from '@/misc/acct.js';
import { CacheService } from '@/core/CacheService.js';
import type { FastifyInstance, FastifyRequest, FastifyReply, FastifyPluginOptions, FastifyBodyParser } from 'fastify';
@@ -842,6 +842,11 @@ export class ActivityPubServerService {
return;
}
+ // Boosts don't federate directly - they should only be referenced as an activity
+ if (isPureRenote(note)) {
+ return 404;
+ }
+
this.setResponseType(request, reply);
const author = await this.usersRepository.findOneByOrFail({ id: note.userId });