aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/utils.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-16 20:22:17 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-16 20:29:26 +0100
commit441b66f80923d1f574a74582f1fb9306b99fc12a (patch)
treeed8a853b9df3666772ec4c027a03c7e05651423c /server/helpers/utils.js
parent9c89a45cb2a7bb46e68fb084723a2046b12c7617 (diff)
downloadPeerTube-441b66f80923d1f574a74582f1fb9306b99fc12a.tar.gz
PeerTube-441b66f80923d1f574a74582f1fb9306b99fc12a.tar.zst
PeerTube-441b66f80923d1f574a74582f1fb9306b99fc12a.zip
Server: forbid to make friends with a non https server
Diffstat (limited to 'server/helpers/utils.js')
-rw-r--r--server/helpers/utils.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/helpers/utils.js b/server/helpers/utils.js
index 9c2d402e3..9f27671b6 100644
--- a/server/helpers/utils.js
+++ b/server/helpers/utils.js
@@ -6,7 +6,8 @@ const logger = require('./logger')
6 6
7const utils = { 7const utils = {
8 cleanForExit, 8 cleanForExit,
9 generateRandomString 9 generateRandomString,
10 isTestInstance
10} 11}
11 12
12function generateRandomString (size, callback) { 13function generateRandomString (size, callback) {
@@ -22,6 +23,10 @@ function cleanForExit (webtorrentProcess) {
22 process.kill(-webtorrentProcess.pid) 23 process.kill(-webtorrentProcess.pid)
23} 24}
24 25
26function isTestInstance () {
27 return (process.env.NODE_ENV === 'test')
28}
29
25// --------------------------------------------------------------------------- 30// ---------------------------------------------------------------------------
26 31
27module.exports = utils 32module.exports = utils