pull/213/head
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
1 changed files with 1 additions and 2 deletions

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