diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-23 15:09:12 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-23 15:09:12 +0100 |
commit | 285fe7c93072b2a8e6a9af6b7e8ffcdefcffbddf (patch) | |
tree | 198ee1eef4094abc4af73b3ff957c1d3b03210e3 /server/lib/activitypub | |
parent | 1ee48d19036199169eca061f1ecccd2f2c8fd359 (diff) | |
download | PeerTube-285fe7c93072b2a8e6a9af6b7e8ffcdefcffbddf.tar.gz PeerTube-285fe7c93072b2a8e6a9af6b7e8ffcdefcffbddf.tar.zst PeerTube-285fe7c93072b2a8e6a9af6b7e8ffcdefcffbddf.zip |
Detect posting request in our own inbox
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r-- | server/lib/activitypub/fetch.ts | 9 |
1 files changed, 9 insertions, 0 deletions
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 @@ | |||
1 | import { logger } from '../../helpers/logger' | ||
2 | import { getServerActor } from '../../helpers/utils' | ||
1 | import { ActorModel } from '../../models/activitypub/actor' | 3 | import { ActorModel } from '../../models/activitypub/actor' |
2 | import { JobQueue } from '../job-queue' | 4 | import { JobQueue } from '../job-queue' |
3 | 5 | ||
4 | async function addFetchOutboxJob (actor: ActorModel) { | 6 | async function addFetchOutboxJob (actor: ActorModel) { |
7 | // Don't fetch ourselves | ||
8 | const serverActor = await getServerActor() | ||
9 | if (serverActor.id === actor.id) { | ||
10 | logger.error('Cannot fetch our own outbox!') | ||
11 | return | ||
12 | } | ||
13 | |||
5 | const payload = { | 14 | const payload = { |
6 | uris: [ actor.outboxUrl ] | 15 | uris: [ actor.outboxUrl ] |
7 | } | 16 | } |