Throw on invalid params argument
This commit is contained in:
parent
94299f0452
commit
ededc73fd7
@ -1,4 +1,7 @@
|
||||
module.exports = function allowQueryParams(params) {
|
||||
if (!Array.isArray(params)) {
|
||||
throw new Error('allowQueryParams must receive an Array of params');
|
||||
}
|
||||
return function allowQueryParamsMiddleware(req, res, next) {
|
||||
req.context.allowedQueryParams = params;
|
||||
next();
|
||||
|
Loading…
Reference in New Issue
Block a user