From a378fc4e687660d2b114b1d5efd6088f6367965a Mon Sep 17 00:00:00 2001 From: javi Date: Fri, 29 Nov 2013 12:46:45 +0100 Subject: [PATCH] fixed #91 --- lib/cartodb/server_options.js | 3 +++ test/unit/cartodb/req2params.test.js | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 27baadba..a93aabc7 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -424,6 +424,9 @@ module.exports = function(){ // bring all query values onto req.params object _.extend(req.params, req.query); + // use both api_key and map_key to auth + req.params.map_key = req.params.map_key || req.params.api_key; + // for cartodb, ensure interactivity is cartodb_id or user specified req.params.interactivity = req.params.interactivity || 'cartodb_id'; diff --git a/test/unit/cartodb/req2params.test.js b/test/unit/cartodb/req2params.test.js index b1e8b12e..5ad1e408 100644 --- a/test/unit/cartodb/req2params.test.js +++ b/test/unit/cartodb/req2params.test.js @@ -77,6 +77,7 @@ suite('req2params', function() { assert.equal(qo.cache_buster, query.cache_buster) assert.equal('test', query.api_key) assert.equal(undefined, query.non_included) + assert.equal(query.map_key, 'test') done(); }); });