This commit is contained in:
javi 2013-11-29 12:46:45 +01:00 committed by Sandro Santilli
parent 01de288c35
commit a378fc4e68
2 changed files with 4 additions and 0 deletions

View File

@ -424,6 +424,9 @@ module.exports = function(){
// bring all query values onto req.params object // bring all query values onto req.params object
_.extend(req.params, req.query); _.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 // for cartodb, ensure interactivity is cartodb_id or user specified
req.params.interactivity = req.params.interactivity || 'cartodb_id'; req.params.interactivity = req.params.interactivity || 'cartodb_id';

View File

@ -77,6 +77,7 @@ suite('req2params', function() {
assert.equal(qo.cache_buster, query.cache_buster) assert.equal(qo.cache_buster, query.cache_buster)
assert.equal('test', query.api_key) assert.equal('test', query.api_key)
assert.equal(undefined, query.non_included) assert.equal(undefined, query.non_included)
assert.equal(query.map_key, 'test')
done(); done();
}); });
}); });