Instead of making all params available in all endpoints, we control what endpoints allow what extra params. Dataviews endpoints should be migrated to this.
7 lines
193 B
JavaScript
7 lines
193 B
JavaScript
module.exports = function allowQueryParams(params) {
|
|
return function allowQueryParamsMiddleware(req, res, next) {
|
|
req.context.allowedQueryParams = params;
|
|
next();
|
|
};
|
|
};
|