From 285fe7c93072b2a8e6a9af6b7e8ffcdefcffbddf Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 23 Feb 2018 15:09:12 +0100 Subject: Detect posting request in our own inbox --- server/lib/activitypub/fetch.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'server/lib/activitypub') diff --git a/server/lib/activitypub/fetch.ts b/server/lib/activitypub/fetch.ts index b1b370a1a..549791f14 100644 --- a/server/lib/activitypub/fetch.ts +++ b/server/lib/activitypub/fetch.ts @@ -1,7 +1,16 @@ +import { logger } from '../../helpers/logger' +import { getServerActor } from '../../helpers/utils' import { ActorModel } from '../../models/activitypub/actor' import { JobQueue } from '../job-queue' async function addFetchOutboxJob (actor: ActorModel) { + // Don't fetch ourselves + const serverActor = await getServerActor() + if (serverActor.id === actor.id) { + logger.error('Cannot fetch our own outbox!') + return + } + const payload = { uris: [ actor.outboxUrl ] } -- cgit v1.2.3