diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/utils.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/utils.js b/server/helpers/utils.js index 9f27671b6..7e0c9823c 100644 --- a/server/helpers/utils.js +++ b/server/helpers/utils.js | |||
@@ -5,11 +5,16 @@ const crypto = require('crypto') | |||
5 | const logger = require('./logger') | 5 | const logger = require('./logger') |
6 | 6 | ||
7 | const utils = { | 7 | const utils = { |
8 | badRequest, | ||
8 | cleanForExit, | 9 | cleanForExit, |
9 | generateRandomString, | 10 | generateRandomString, |
10 | isTestInstance | 11 | isTestInstance |
11 | } | 12 | } |
12 | 13 | ||
14 | function badRequest (req, res, next) { | ||
15 | res.type('json').status(400).end() | ||
16 | } | ||
17 | |||
13 | function generateRandomString (size, callback) { | 18 | function generateRandomString (size, callback) { |
14 | crypto.pseudoRandomBytes(size, function (err, raw) { | 19 | crypto.pseudoRandomBytes(size, function (err, raw) { |
15 | if (err) return callback(err) | 20 | if (err) return callback(err) |