From f824fc52435a94c8591a4ea27371a67a4594157f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Mart=C3=ADn?= Date: Thu, 28 Sep 2017 12:02:34 +0200 Subject: [PATCH] base and analyses controller --- lib/cartodb/controllers/analyses.js | 2 +- lib/cartodb/controllers/base.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cartodb/controllers/analyses.js b/lib/cartodb/controllers/analyses.js index ebe9c007..e230f350 100644 --- a/lib/cartodb/controllers/analyses.js +++ b/lib/cartodb/controllers/analyses.js @@ -44,7 +44,7 @@ AnalysesController.prototype.catalog = function (req, res, next) { step( function catalogQuery() { - var pg = new PSQL(dbParamsFromReqParams(req.params)); + var pg = new PSQL(dbParamsFromReqParams(res.locals.db)); getMetadata(username, pg, this); }, function prepareResponse(err, results) { diff --git a/lib/cartodb/controllers/base.js b/lib/cartodb/controllers/base.js index 7462f6ba..769a9228 100644 --- a/lib/cartodb/controllers/base.js +++ b/lib/cartodb/controllers/base.js @@ -7,8 +7,8 @@ module.exports = BaseController; // jshint maxcomplexity:9 BaseController.prototype.send = function(req, res, body, status, headers) { - if (req.params.dbhost) { - res.set('X-Served-By-DB-Host', req.params.dbhost); + if (res.locals.db.dbhost) { + res.set('X-Served-By-DB-Host', res.locals.db.dbhost); } res.set('X-Tiler-Profiler', req.profiler.toJSONString());