From 74b2f305eac25bc88bbc907e242df500b7f57787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 7 Mar 2018 19:09:52 +0100 Subject: [PATCH] Extract initProfiler middleware from map-controller --- lib/cartodb/controllers/map.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cartodb/controllers/map.js b/lib/cartodb/controllers/map.js index a9077339..9c2168d5 100644 --- a/lib/cartodb/controllers/map.js +++ b/lib/cartodb/controllers/map.js @@ -72,7 +72,7 @@ MapController.prototype.composeCreateMapMiddleware = function (useTemplate = fal userMiddleware(), allowQueryParams(['aggregation']), this.prepareContext, - this.initProfiler(isTemplateInstantiation), + initProfiler(isTemplateInstantiation), this.checkJsonContentType(), useTemplate ? this.checkInstantiteLayergroup() : this.checkCreateLayergroup(), useTemplate ? this.getTemplate() : this.prepareAdapterMapConfig(), @@ -97,7 +97,7 @@ MapController.prototype.composeCreateMapMiddleware = function (useTemplate = fal ]; }; -MapController.prototype.initProfiler = function (isTemplateInstantiation) { +function initProfiler (isTemplateInstantiation) { const operation = isTemplateInstantiation ? 'instance_template' : 'createmap'; return function initProfilerMiddleware (req, res, next) { @@ -105,7 +105,7 @@ MapController.prototype.initProfiler = function (isTemplateInstantiation) { req.profiler.done(`${operation}.initProfilerMiddleware`); next(); }; -}; +} MapController.prototype.checkJsonContentType = function () { return function checkJsonContentTypeMiddleware(req, res, next) {