diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-11-16 20:22:17 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-11-16 20:29:26 +0100 |
commit | 441b66f80923d1f574a74582f1fb9306b99fc12a (patch) | |
tree | ed8a853b9df3666772ec4c027a03c7e05651423c /server/helpers | |
parent | 9c89a45cb2a7bb46e68fb084723a2046b12c7617 (diff) | |
download | PeerTube-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')
-rw-r--r-- | server/helpers/utils.js | 7 |
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 | ||
7 | const utils = { | 7 | const utils = { |
8 | cleanForExit, | 8 | cleanForExit, |
9 | generateRandomString | 9 | generateRandomString, |
10 | isTestInstance | ||
10 | } | 11 | } |
11 | 12 | ||
12 | function generateRandomString (size, callback) { | 13 | function generateRandomString (size, callback) { |
@@ -22,6 +23,10 @@ function cleanForExit (webtorrentProcess) { | |||
22 | process.kill(-webtorrentProcess.pid) | 23 | process.kill(-webtorrentProcess.pid) |
23 | } | 24 | } |
24 | 25 | ||
26 | function isTestInstance () { | ||
27 | return (process.env.NODE_ENV === 'test') | ||
28 | } | ||
29 | |||
25 | // --------------------------------------------------------------------------- | 30 | // --------------------------------------------------------------------------- |
26 | 31 | ||
27 | module.exports = utils | 32 | module.exports = utils |