diff options
Diffstat (limited to 'server/helpers/requests.ts')
-rw-r--r-- | server/helpers/requests.ts | 6 |
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 @@ | |||
1 | import * as Bluebird from 'bluebird' | 1 | import * as Bluebird from 'bluebird' |
2 | import { createWriteStream, remove } from 'fs-extra' | 2 | import { createWriteStream, remove } from 'fs-extra' |
3 | import * as request from 'request' | 3 | import * as request from 'request' |
4 | import { ACTIVITY_PUB, WEBSERVER } from '../initializers/constants' | 4 | import { ACTIVITY_PUB, PEERTUBE_VERSION, WEBSERVER } from '../initializers/constants' |
5 | import { processImage } from './image-utils' | 5 | import { processImage } from './image-utils' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { logger } from './logger' | 7 | import { logger } from './logger' |
8 | import { CONFIG } from '../initializers/config' | 8 | import { CONFIG } from '../initializers/config' |
9 | 9 | ||
10 | const packageJSON = require('../../../package.json') | ||
11 | |||
12 | function doRequest <T> ( | 10 | function 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 | ||
70 | function getUserAgent () { | 68 | function getUserAgent () { |
71 | return `PeerTube/${packageJSON.version} (+${WEBSERVER.URL})` | 69 | return `PeerTube/${PEERTUBE_VERSION} (+${WEBSERVER.URL})` |
72 | } | 70 | } |
73 | 71 | ||
74 | // --------------------------------------------------------------------------- | 72 | // --------------------------------------------------------------------------- |