From ec41cddb19b71390b5c85b9c457e52815a3b4aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 7 Mar 2018 12:52:44 +0100 Subject: [PATCH] Do not pass the whole res.locals to backends --- lib/cartodb/controllers/layergroup.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/cartodb/controllers/layergroup.js b/lib/cartodb/controllers/layergroup.js index 405857ad..6a50862f 100644 --- a/lib/cartodb/controllers/layergroup.js +++ b/lib/cartodb/controllers/layergroup.js @@ -312,8 +312,9 @@ LayergroupController.prototype.getMapStoreMapConfigProvider = function (mapStore LayergroupController.prototype.getDataview = function (dataviewBackend) { return function getDataviewMiddleware (req, res, next) { const { user, mapConfigProvider } = res.locals; + const params = getRequestParams(res.locals); - dataviewBackend.getDataview(mapConfigProvider, user, res.locals, (err, dataview, stats = {}) => { + dataviewBackend.getDataview(mapConfigProvider, user, params, (err, dataview, stats = {}) => { req.profiler.add(stats); if (err) { @@ -331,8 +332,9 @@ LayergroupController.prototype.getDataview = function (dataviewBackend) { LayergroupController.prototype.dataviewSearch = function (dataviewBackend) { return function dataviewSearchMiddlewarify (req, res, next) { const { user, dataviewName, mapConfigProvider } = res.locals; + const params = getRequestParams(res.locals); - dataviewBackend.search(mapConfigProvider, user, dataviewName, res.locals, (err, searchResult, stats = {}) => { + dataviewBackend.search(mapConfigProvider, user, dataviewName, params, (err, searchResult, stats = {}) => { req.profiler.add(stats); if (err) { @@ -352,8 +354,9 @@ LayergroupController.prototype.attributes = function (attributesBackend) { req.profiler.start('windshaft.maplayer_attribute'); const { mapConfigProvider } = res.locals; + const params = getRequestParams(res.locals); - attributesBackend.getFeatureAttributes(mapConfigProvider, res.locals, false, (err, tile, stats = {}) => { + attributesBackend.getFeatureAttributes(mapConfigProvider, params, false, (err, tile, stats = {}) => { req.profiler.add(stats); if (err) {