Follow middleware pattern
This commit is contained in:
@@ -87,7 +87,7 @@ LayergroupController.prototype.register = function(app) {
|
||||
`${basePath}/:token/:layer/:z/:x/:y.(:format)`,
|
||||
cors(),
|
||||
userMiddleware,
|
||||
validateLayerRouteMiddleware,
|
||||
validateLayerRoute(),
|
||||
this.prepareContext,
|
||||
this.getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
|
||||
this.layer(this.tileBackend),
|
||||
@@ -244,12 +244,14 @@ LayergroupController.prototype.register = function(app) {
|
||||
);
|
||||
};
|
||||
|
||||
function validateLayerRouteMiddleware(req, res, next) {
|
||||
if (req.params.token === 'static') {
|
||||
return next('route');
|
||||
}
|
||||
function validateLayerRoute () {
|
||||
return function validateLayerRouteMiddleware(req, res, next) {
|
||||
if (req.params.token === 'static') {
|
||||
return next('route');
|
||||
}
|
||||
|
||||
next();
|
||||
next();
|
||||
};
|
||||
}
|
||||
|
||||
LayergroupController.prototype.analysisNodeStatus = function (analysisStatusBackend) {
|
||||
|
||||
Reference in New Issue
Block a user