diff --git a/lib/cartodb/api/template/tile-template-controller.js b/lib/cartodb/api/template/tile-template-controller.js index e4d80663..71a45e6e 100644 --- a/lib/cartodb/api/template/tile-template-controller.js +++ b/lib/cartodb/api/template/tile-template-controller.js @@ -30,8 +30,11 @@ module.exports = class TileTemplateController { } register (templateRouter) { - templateRouter.get( - `/:template_id/:layer/:z/:x/:y.(:format)`, + templateRouter.get('/:template_id/:layer/:z/:x/:y.(:format)', this.middlewares()); + } + + middlewares () { + return [ coordinates(), credentials(), authorize(this.authBackend), @@ -52,7 +55,7 @@ module.exports = class TileTemplateController { surrogateKeyHeader({ surrogateKeysCache: this.surrogateKeysCache }), lastModifiedHeader(), vectorError() - ); + ]; } };