aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/utils.js5
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')
5const logger = require('./logger') 5const logger = require('./logger')
6 6
7const utils = { 7const utils = {
8 badRequest,
8 cleanForExit, 9 cleanForExit,
9 generateRandomString, 10 generateRandomString,
10 isTestInstance 11 isTestInstance
11} 12}
12 13
14function badRequest (req, res, next) {
15 res.type('json').status(400).end()
16}
17
13function generateRandomString (size, callback) { 18function 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)