aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/requests.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/requests.ts')
-rw-r--r--server/helpers/requests.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts
index 80476d649..b556c392e 100644
--- a/server/helpers/requests.ts
+++ b/server/helpers/requests.ts
@@ -1,14 +1,12 @@
1import * as Bluebird from 'bluebird' 1import * as Bluebird from 'bluebird'
2import { createWriteStream, remove } from 'fs-extra' 2import { createWriteStream, remove } from 'fs-extra'
3import * as request from 'request' 3import * as request from 'request'
4import { ACTIVITY_PUB, WEBSERVER } from '../initializers/constants' 4import { ACTIVITY_PUB, PEERTUBE_VERSION, WEBSERVER } from '../initializers/constants'
5import { processImage } from './image-utils' 5import { processImage } from './image-utils'
6import { join } from 'path' 6import { join } from 'path'
7import { logger } from './logger' 7import { logger } from './logger'
8import { CONFIG } from '../initializers/config' 8import { CONFIG } from '../initializers/config'
9 9
10const packageJSON = require('../../../package.json')
11
12function doRequest <T> ( 10function doRequest <T> (
13 requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean }, 11 requestOptions: request.CoreOptions & request.UriOptions & { activityPub?: boolean },
14 bodyKBLimit = 1000 // 1MB 12 bodyKBLimit = 1000 // 1MB
@@ -68,7 +66,7 @@ async function downloadImage (url: string, destDir: string, destName: string, si
68} 66}
69 67
70function getUserAgent () { 68function getUserAgent () {
71 return `PeerTube/${packageJSON.version} (+${WEBSERVER.URL})` 69 return `PeerTube/${PEERTUBE_VERSION} (+${WEBSERVER.URL})`
72} 70}
73 71
74// --------------------------------------------------------------------------- 72// ---------------------------------------------------------------------------