diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts index d920f62..461b40c 100644 --- a/server/helpers/requests.ts +++ b/server/helpers/requests.ts @@ -4,6 +4,9 @@ import * as request from 'request' function doRequest ( requestOptions: request.CoreOptions & request.UriOptions ): Bluebird<{ response: request.RequestResponse, body: T }> { + if (!(requestOptions.headers)) requestOptions.headers = {} + requestOptions.headers['User-Agent'] = 'PeerTube indexer' + return new Bluebird<{ response: request.RequestResponse, body: T }>((res, rej) => { request(requestOptions, (err, response, body) => err ? rej(err) : res({ response, body })) })