From 1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sat, 20 Aug 2016 16:59:25 +0200 Subject: Server: make friends urls come from the request instead of the configuration file --- server/middlewares/validators/pods.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server/middlewares/validators') diff --git a/server/middlewares/validators/pods.js b/server/middlewares/validators/pods.js index fda2e865f..7c4d04aff 100644 --- a/server/middlewares/validators/pods.js +++ b/server/middlewares/validators/pods.js @@ -10,6 +10,11 @@ const validatorsPod = { } function makeFriends (req, res, next) { + req.checkBody('urls', 'Should have an array of urls').isArray() + req.checkBody('urls', 'Should be an url').isEachUrl() + + logger.debug('Checking makeFriends parameters', { parameters: req.body }) + friends.hasFriends(function (err, hasFriends) { if (err) { logger.error('Cannot know if we have friends.', { error: err }) -- cgit v1.2.3