aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/utils.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-12-30 12:53:41 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-12-30 12:53:41 +0100
commita6fd2b30bf717eec14972a2175354781f5f43e77 (patch)
tree0a4fcd68e5630cf4a3274d087b4be54beac64bfa /server/helpers/utils.js
parent8fd66b75bfbd8fd4945f1944411461b05eb74795 (diff)
downloadPeerTube-a6fd2b30bf717eec14972a2175354781f5f43e77.tar.gz
PeerTube-a6fd2b30bf717eec14972a2175354781f5f43e77.tar.zst
PeerTube-a6fd2b30bf717eec14972a2175354781f5f43e77.zip
Server: move remote routes in their own directory
Diffstat (limited to 'server/helpers/utils.js')
-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)