diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index be05d495..f57248fa 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -166,26 +166,6 @@ var CartodbWindshaft = function(serverOptions) { * END Routing ******************************************************************************************************************/ - /** - * Helper to allow access to metadata to be used in embedded maps. - */ - ws.get(serverOptions.base_url + '/map_metadata', function(req, res){ - ws.doCORS(res); - Step( - function(){ - serverOptions.getMapMetadata(req, this); - }, - function(err, data){ - if (err){ - ws.sendError(res, {error: err.message}, 500, 'GET MAP_METADATA', err); - //ws.sendResponse(res, [err.message, 500]); - } else { - ws.sendResponse(res, [{map_metadata: data}, 200]); - } - } - ); - }); - /** * Helper API to allow per table tile cache (and sql cache) to be invalidated remotely. * Keep endpoint for backwards compatibility diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 8b051fc0..e6ef0330 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -766,34 +766,5 @@ module.exports = function(redisPool) { ); }; - - /** - * Little helper method to get map metadata and return to client - * @param req - * @param callback - */ - me.getMapMetadata = function(req, callback){ - var that = this; - var user = me.userByReq(req); - - Step( - function(){ - // TODO: if this step really needed ? - that.req2params(req, this); - }, - function getDatabase(err){ - if (err) throw err; - cartoData.getUserDBName(user, this); - }, - function getMapMetadata(err, dbname){ - if (err) throw err; - cartoData.getTableMapMetadata(dbname, req.params.table, this); - }, - function(err, data){ - callback(err, data); - } - ); - }; - return me; }; diff --git a/test/acceptance/server.js b/test/acceptance/server.js index bf3514bb..8378c642 100644 --- a/test/acceptance/server.js +++ b/test/acceptance/server.js @@ -1208,60 +1208,6 @@ suite('multilayer:postgres=' + cdbQueryTablesFromPostgresEnabledValue, function( }); }); - ///////////////////////////////////////////////////////////////////////////////// - // - // GET METADATA - // - ///////////////////////////////////////////////////////////////////////////////// - - test("does not provide metadata of private table to unauthenticated requests", function(done){ - assert.response(server, { - headers: {host: 'localhost'}, - url: '/tiles/test_table_private_1/map_metadata', - method: 'GET' - },{}, function(res) { - // FIXME: should be 403 instead - assert.equal(res.statusCode, 500, res.statusCode + ': ' + res.body); - assert.ok(!res.headers.hasOwnProperty('cache-control')); - done(); - }); - }); - - test("does provide metadata of private table to authenticated requests", function(done){ - assert.response(server, { - headers: {host: 'localhost'}, - url: '/tiles/test_table_private_1/map_metadata?map_key=1234', - method: 'GET' - },{}, function(res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); - done(); - }); - }); - - test("does provide metadata of public table to unauthenticated requests", function(done){ - assert.response(server, { - headers: {host: 'localhost'}, - url: '/tiles/gadm4/map_metadata', - method: 'GET' - },{}, function(res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); - // TODO: show metadata ? - done(); - }); - }); - - test("does provide metadata of public table to authenticated requests", function(done){ - assert.response(server, { - headers: {host: 'localhost'}, - url: '/tiles/gadm4/map_metadata?map_key=1234', - method: 'GET' - },{}, function(res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); - // TODO: show metadata ? - done(); - }); - }); - ///////////////////////////////////////////////////////////////////////////////// // // DELETE CACHE