Windshaft-cartodb/lib/cartodb/middleware/allow-query-params.js
2017-10-03 17:47:57 +02:00

10 lines
309 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();
};
};