aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-18 15:56:42 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit60cfd4cb54138e7da76054aa163b33b3223b17ef (patch)
tree0eab3e236b8a3637c341ee4391db464f0abc95d9 /server/middlewares/validators
parentb4055e1c23eeefb0c8a85a77f312b2827d98f483 (diff)
downloadPeerTube-60cfd4cb54138e7da76054aa163b33b3223b17ef.tar.gz
PeerTube-60cfd4cb54138e7da76054aa163b33b3223b17ef.tar.zst
PeerTube-60cfd4cb54138e7da76054aa163b33b3223b17ef.zip
Add plugins check params tests
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/plugins.ts5
1 files changed, 1 insertions, 4 deletions
diff --git a/server/middlewares/validators/plugins.ts b/server/middlewares/validators/plugins.ts
index 8cb3153aa..68704bf56 100644
--- a/server/middlewares/validators/plugins.ts
+++ b/server/middlewares/validators/plugins.ts
@@ -88,7 +88,7 @@ const uninstallPluginValidator = [
88] 88]
89 89
90const existingPluginValidator = [ 90const existingPluginValidator = [
91 param('npmName').custom(isPluginNameValid).withMessage('Should have a valid plugin name'), 91 param('npmName').custom(isNpmPluginNameValid).withMessage('Should have a valid plugin name'),
92 92
93 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 93 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
94 logger.debug('Checking enabledPluginValidator parameters', { parameters: req.params }) 94 logger.debug('Checking enabledPluginValidator parameters', { parameters: req.params })
@@ -121,9 +121,6 @@ const updatePluginSettingsValidator = [
121] 121]
122 122
123const listAvailablePluginsValidator = [ 123const listAvailablePluginsValidator = [
124 query('sort')
125 .optional()
126 .exists().withMessage('Should have a valid sort'),
127 query('search') 124 query('search')
128 .optional() 125 .optional()
129 .exists().withMessage('Should have a valid search'), 126 .exists().withMessage('Should have a valid search'),