Do not use middleware local in map controller

This commit is contained in:
Daniel García Aubert 2018-03-23 16:08:52 +01:00
parent f76606bc26
commit 516b1f765e

View File

@ -5,7 +5,6 @@ const Datasource = windshaft.model.Datasource;
const ResourceLocator = require('../models/resource-locator');
const cors = require('../middleware/cors');
const user = require('../middleware/user');
const locals = require('../middleware/locals');
const cleanUpQueryParams = require('../middleware/clean-up-query-params');
const layergroupToken = require('../middleware/layergroup-token');
const credentials = require('../middleware/credentials');
@ -103,7 +102,6 @@ MapController.prototype.composeCreateMapMiddleware = function (endpointGroup, us
return [
cors(),
cleanUpQueryParams(['aggregation']),
locals(),
user(),
rateLimit(this.userLimitsApi, endpointGroup),
layergroupToken(),
@ -214,7 +212,7 @@ function checkInstantiteLayergroup () {
function checkCreateLayergroup () {
return function checkCreateLayergroupMiddleware (req, res, next) {
if (req.method === 'GET') {
const { config } = res.locals;
const { config } = req.query;
if (!config) {
return next(new Error('layergroup GET needs a "config" parameter'));