aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/requests.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts
index ce185a2c0..ac3559c58 100644
--- a/server/helpers/requests.ts
+++ b/server/helpers/requests.ts
@@ -1,9 +1,13 @@
1import * as Promise from 'bluebird' 1import * as Promise from 'bluebird'
2import { createWriteStream } from 'fs' 2import { createWriteStream } from 'fs'
3import { RequestResponse } from 'request'
3import * as request from 'request' 4import * as request from 'request'
4import { ACTIVITY_PUB } from '../initializers' 5import { ACTIVITY_PUB } from '../initializers'
6import Bluebird = require('bluebird')
5 7
6function doRequest (requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean }) { 8function doRequest (
9 requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean }
10): Bluebird<{ response: RequestResponse, body: any }> {
7 if (requestOptions.activityPub === true) { 11 if (requestOptions.activityPub === true) {
8 if (!Array.isArray(requestOptions.headers)) requestOptions.headers = {} 12 if (!Array.isArray(requestOptions.headers)) requestOptions.headers = {}
9 requestOptions.headers['accept'] = ACTIVITY_PUB.ACCEPT_HEADER 13 requestOptions.headers['accept'] = ACTIVITY_PUB.ACCEPT_HEADER