Move note about username extraction to cartodb_request

This commit is contained in:
Raul Ochoa 2015-02-02 12:15:53 +01:00
parent e5ab4272eb
commit 302a856d37
2 changed files with 3 additions and 1 deletions

View File

@ -210,7 +210,6 @@ function handleQuery(req, res) {
var requestedFilename = params.filename;
var filename = requestedFilename;
var requestedSkipfields = params.skipfields;
// if the request contains the user use it, if not guess from the host
var cdbUsername = cdbReq.userByReq(req);
var skipfields;
var dp = params.dp; // decimal point digits (defaults to 6)

View File

@ -8,6 +8,9 @@ function CartodbRequest() {
module.exports = CartodbRequest;
/**
* If the request contains the user use it, if not guess from the host
*/
CartodbRequest.prototype.userByReq = function(req) {
if (req.params.user) {
return req.params.user;