Use spread operator
This commit is contained in:
parent
0aa8d63a6e
commit
67d2d2fe95
@ -20,11 +20,7 @@ module.exports = function cleanUpQueryParamsMiddleware (customQueryParams = [])
|
||||
}
|
||||
|
||||
return function cleanUpQueryParams (req, res, next) {
|
||||
var allowedQueryParams = REQUEST_QUERY_PARAMS_WHITELIST;
|
||||
|
||||
if (Array.isArray(customQueryParams)) {
|
||||
allowedQueryParams = allowedQueryParams.concat(customQueryParams);
|
||||
}
|
||||
const allowedQueryParams = [...REQUEST_QUERY_PARAMS_WHITELIST, ...customQueryParams];
|
||||
|
||||
req.query = _.pick(req.query, allowedQueryParams);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user