]>
Commit | Line | Data |
---|---|---|
9f10b292 | 1 | 'use strict' |
34ca3b52 | 2 | |
f0f5567b C |
3 | const checkErrors = require('./utils').checkErrors |
4 | const logger = require('../../helpers/logger') | |
34ca3b52 | 5 | |
fc51fde0 | 6 | const validatorsRemote = { |
c4403b29 C |
7 | remoteVideos, |
8 | signature | |
9f10b292 | 9 | } |
34ca3b52 | 10 | |
528a9efa | 11 | function remoteVideos (req, res, next) { |
528a9efa | 12 | req.checkBody('data').isEachRemoteVideosValid() |
34ca3b52 | 13 | |
aaf61f38 | 14 | logger.debug('Checking remoteVideos parameters', { parameters: req.body }) |
34ca3b52 | 15 | |
9f10b292 C |
16 | checkErrors(req, res, next) |
17 | } | |
34ca3b52 | 18 | |
528a9efa | 19 | function signature (req, res, next) { |
49abbbbe | 20 | req.checkBody('signature.host', 'Should have a signature host').isURL() |
9f10b292 | 21 | req.checkBody('signature.signature', 'Should have a signature').notEmpty() |
c45f7f84 | 22 | |
49abbbbe | 23 | logger.debug('Checking signature parameters', { parameters: { signatureHost: req.body.signature.host } }) |
c45f7f84 | 24 | |
9f10b292 C |
25 | checkErrors(req, res, next) |
26 | } | |
c45f7f84 | 27 | |
9f10b292 | 28 | // --------------------------------------------------------------------------- |
c45f7f84 | 29 | |
fc51fde0 | 30 | module.exports = validatorsRemote |