aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/requests.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-11-14 15:01:28 +0100
committerChocobozzz <me@florianbigard.com>2018-11-14 16:32:27 +0100
commit5c6d985faeef1d6793d3f44ca6374f1a9b722806 (patch)
tree567e31a84e721bf762189582f92ac2ec5c402bcc /server/helpers/requests.ts
parentdf66d81583e07ce049daeeef1edc6a87b57b3684 (diff)
downloadPeerTube-5c6d985faeef1d6793d3f44ca6374f1a9b722806.tar.gz
PeerTube-5c6d985faeef1d6793d3f44ca6374f1a9b722806.tar.zst
PeerTube-5c6d985faeef1d6793d3f44ca6374f1a9b722806.zip
Check activities host
Diffstat (limited to 'server/helpers/requests.ts')
-rw-r--r--server/helpers/requests.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts
index ee9e80404..51facc9e0 100644
--- a/server/helpers/requests.ts
+++ b/server/helpers/requests.ts
@@ -3,7 +3,7 @@ import { createWriteStream } from 'fs-extra'
3import * as request from 'request' 3import * as request from 'request'
4import { ACTIVITY_PUB } from '../initializers' 4import { ACTIVITY_PUB } from '../initializers'
5 5
6function doRequest ( 6function doRequest <T> (
7 requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean } 7 requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean }
8): Bluebird<{ response: request.RequestResponse, body: any }> { 8): Bluebird<{ response: request.RequestResponse, body: any }> {
9 if (requestOptions.activityPub === true) { 9 if (requestOptions.activityPub === true) {
@@ -11,7 +11,7 @@ function doRequest (
11 requestOptions.headers['accept'] = ACTIVITY_PUB.ACCEPT_HEADER 11 requestOptions.headers['accept'] = ACTIVITY_PUB.ACCEPT_HEADER
12 } 12 }
13 13
14 return new Bluebird<{ response: request.RequestResponse, body: any }>((res, rej) => { 14 return new Bluebird<{ response: request.RequestResponse, body: T }>((res, rej) => {
15 request(requestOptions, (err, response, body) => err ? rej(err) : res({ response, body })) 15 request(requestOptions, (err, response, body) => err ? rej(err) : res({ response, body }))
16 }) 16 })
17} 17}