Remove legacy hack
This commit is contained in:
parent
ff19a8a2fe
commit
85d4c81e58
@ -27,11 +27,12 @@ var REQUEST_QUERY_PARAMS_WHITELIST = [
|
||||
module.exports = function prepareContextMiddleware (authApi, pgConnection) {
|
||||
return function prepareContext (req, res, next) {
|
||||
var allowedQueryParams = REQUEST_QUERY_PARAMS_WHITELIST;
|
||||
|
||||
if (Array.isArray(req.context.allowedQueryParams)) {
|
||||
allowedQueryParams = allowedQueryParams.concat(req.context.allowedQueryParams);
|
||||
}
|
||||
|
||||
req.query = _.pick(req.query, allowedQueryParams);
|
||||
req.params = _.extend({}, req.params); // shuffle things as request is a strange array/object
|
||||
|
||||
var user = req.context.user;
|
||||
|
||||
|
@ -39,6 +39,7 @@ describe('prepare-context', function() {
|
||||
done: function() {}
|
||||
};
|
||||
req.context = { user: 'localhost' };
|
||||
req.params = {};
|
||||
return req;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user