diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-17 10:03:55 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 66170ca8c64fa4e76f3830e4a02a11345a03093b (patch) | |
tree | d2ef070a8e3cc98badcf6492f4d7db345c157d91 /server/helpers | |
parent | 109d893ff5353c3061af3062cf9443bcba39aafc (diff) | |
download | PeerTube-66170ca8c64fa4e76f3830e4a02a11345a03093b.tar.gz PeerTube-66170ca8c64fa4e76f3830e4a02a11345a03093b.tar.zst PeerTube-66170ca8c64fa4e76f3830e4a02a11345a03093b.zip |
Use process.env.npm_package_version
Diffstat (limited to 'server/helpers')
-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 | // --------------------------------------------------------------------------- |