diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-19 10:34:56 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-19 10:53:16 +0100 |
commit | e12a009254de33bcdbd8334992980fa029c3e10d (patch) | |
tree | 85c6b576d9f76fee33b22e1fdbdca5e9daa24d50 /server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts | |
parent | ce33ee01cd3806201b676c318e9aa930032921b2 (diff) | |
download | PeerTube-e12a009254de33bcdbd8334992980fa029c3e10d.tar.gz PeerTube-e12a009254de33bcdbd8334992980fa029c3e10d.tar.zst PeerTube-e12a009254de33bcdbd8334992980fa029c3e10d.zip |
Status are sent to mastodon
Diffstat (limited to 'server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts')
-rw-r--r-- | server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts index f16cfcec3..7a5caa679 100644 --- a/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts +++ b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-unicast-handler.ts | |||
@@ -1,16 +1,18 @@ | |||
1 | import { doRequest, logger } from '../../../helpers' | 1 | import { doRequest, logger } from '../../../helpers' |
2 | import { ActivityPubHttpPayload, computeBody, maybeRetryRequestLater } from './activitypub-http-job-scheduler' | 2 | import { ActivityPubHttpPayload, buildSignedRequestOptions, computeBody, maybeRetryRequestLater } from './activitypub-http-job-scheduler' |
3 | 3 | ||
4 | async function process (payload: ActivityPubHttpPayload, jobId: number) { | 4 | async function process (payload: ActivityPubHttpPayload, jobId: number) { |
5 | logger.info('Processing ActivityPub unicast in job %d.', jobId) | 5 | logger.info('Processing ActivityPub unicast in job %d.', jobId) |
6 | 6 | ||
7 | const body = await computeBody(payload) | 7 | const body = await computeBody(payload) |
8 | const httpSignatureOptions = await buildSignedRequestOptions(payload) | ||
8 | 9 | ||
9 | const uri = payload.uris[0] | 10 | const uri = payload.uris[0] |
10 | const options = { | 11 | const options = { |
11 | method: 'POST', | 12 | method: 'POST', |
12 | uri, | 13 | uri, |
13 | json: body | 14 | json: body, |
15 | httpSignature: httpSignatureOptions | ||
14 | } | 16 | } |
15 | 17 | ||
16 | try { | 18 | try { |