diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 786aac0d..957deb66 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -281,7 +281,7 @@ module.exports = function(){ sql = sql.join(';'); var dbName = req.params.dbname; - var usr = req.headers.host.split('.')[0]; + var usr = this.userByReq(req); var key = req.params.map_key; var cacheKey = dbName + ':' + token;