Do not pass the whole res.locals to backends
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user