aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-17 10:03:55 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit66170ca8c64fa4e76f3830e4a02a11345a03093b (patch)
treed2ef070a8e3cc98badcf6492f4d7db345c157d91 /server/helpers
parent109d893ff5353c3061af3062cf9443bcba39aafc (diff)
downloadPeerTube-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.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// ---------------------------------------------------------------------------