diff --git a/lib/cartodb/api/map/anonymous-map-controller.js b/lib/cartodb/api/map/anonymous-map-controller.js index c50b9eb9..1a1f6eea 100644 --- a/lib/cartodb/api/map/anonymous-map-controller.js +++ b/lib/cartodb/api/map/anonymous-map-controller.js @@ -158,7 +158,10 @@ function prepareAdapterMapConfig (mapConfigAdapter) { context, (err, requestMapConfig, stats = { overviewsUsed : false }) => { req.profiler.done('anonymous.getMapConfig'); + + stats.mapType = 'anonymous'; req.profiler.add(stats); + if (err) { return next(err); diff --git a/lib/cartodb/models/mapconfig/adapter/mapconfig-overviews-adapter.js b/lib/cartodb/models/mapconfig/adapter/mapconfig-overviews-adapter.js index 81bbce9f..ff9ecbf6 100644 --- a/lib/cartodb/models/mapconfig/adapter/mapconfig-overviews-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/mapconfig-overviews-adapter.js @@ -37,8 +37,7 @@ MapConfigOverviewsAdapter.prototype.getMapConfig = function (user, requestMapCon requestMapConfig.layers = layers; - const stats = { overviewsAddedToMapconfig, - mapType: 'anonymous' }; + const stats = { overviewsAddedToMapconfig }; return callback(null, requestMapConfig, stats); }); diff --git a/test/acceptance/overviews_metadata.js b/test/acceptance/overviews_metadata.js index a800e899..fe6470f0 100644 --- a/test/acceptance/overviews_metadata.js +++ b/test/acceptance/overviews_metadata.js @@ -72,7 +72,12 @@ describe('overviews metadata', function() { data: JSON.stringify(layergroup) }, {}, function(res) { assert.equal(res.statusCode, 200, res.body); - assert.ok(JSON.parse(res.headers['x-tiler-profiler']).overviewsAddedToMapconfig); + + const headers = JSON.parse(res.headers['x-tiler-profiler']); + + assert.ok(headers.overviewsAddedToMapconfig); + assert.equal(headers.mapType, 'anonymous'); + var parsedBody = JSON.parse(res.body); assert.equal(res.headers['x-layergroup-id'], parsedBody.layergroupid); expected_token = parsedBody.layergroupid;