aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-23 15:09:12 +0100
committerChocobozzz <me@florianbigard.com>2018-02-23 15:09:12 +0100
commit285fe7c93072b2a8e6a9af6b7e8ffcdefcffbddf (patch)
tree198ee1eef4094abc4af73b3ff957c1d3b03210e3 /server/lib/activitypub
parent1ee48d19036199169eca061f1ecccd2f2c8fd359 (diff)
downloadPeerTube-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.ts9
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 @@
1import { logger } from '../../helpers/logger'
2import { getServerActor } from '../../helpers/utils'
1import { ActorModel } from '../../models/activitypub/actor' 3import { ActorModel } from '../../models/activitypub/actor'
2import { JobQueue } from '../job-queue' 4import { JobQueue } from '../job-queue'
3 5
4async function addFetchOutboxJob (actor: ActorModel) { 6async 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 }