From 441b66f80923d1f574a74582f1fb9306b99fc12a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 16 Nov 2016 20:22:17 +0100 Subject: Server: forbid to make friends with a non https server --- server/helpers/utils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'server/helpers') 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') const utils = { cleanForExit, - generateRandomString + generateRandomString, + isTestInstance } function generateRandomString (size, callback) { @@ -22,6 +23,10 @@ function cleanForExit (webtorrentProcess) { process.kill(-webtorrentProcess.pid) } +function isTestInstance () { + return (process.env.NODE_ENV === 'test') +} + // --------------------------------------------------------------------------- module.exports = utils -- cgit v1.2.3