Files
Windshaft-cartodb/lib/cartodb/middleware/allow-query-params.js
Daniel García Aubert ef3ffddec7 Cosmetic changes
2018-03-01 18:49:44 +01:00

11 lines
312 B
JavaScript

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) {
res.locals.allowedQueryParams = params;
next();
};
};