1
0
Fork 0
This commit is contained in:
Chocobozzz 2018-01-15 10:03:13 +01:00
parent 7006bc6378
commit 633868bc2c
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -1,13 +1,12 @@
import * as Promise from 'bluebird' import * as Promise from 'bluebird'
import { createWriteStream } from 'fs' import { createWriteStream } from 'fs'
import { RequestResponse } from 'request'
import * as request from 'request' import * as request from 'request'
import { ACTIVITY_PUB } from '../initializers' import { ACTIVITY_PUB } from '../initializers'
import Bluebird = require('bluebird') import Bluebird = require('bluebird')
function doRequest ( function doRequest (
requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean } requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean }
): Bluebird<{ response: RequestResponse, body: any }> { ): Bluebird<{ response: request.RequestResponse, body: any }> {
if (requestOptions.activityPub === true) { if (requestOptions.activityPub === true) {
if (!Array.isArray(requestOptions.headers)) requestOptions.headers = {} if (!Array.isArray(requestOptions.headers)) requestOptions.headers = {}
requestOptions.headers['accept'] = ACTIVITY_PUB.ACCEPT_HEADER requestOptions.headers['accept'] = ACTIVITY_PUB.ACCEPT_HEADER