base and analyses controller

This commit is contained in:
Simon Martín 2017-09-28 12:02:34 +02:00
parent 4a2cc6a5f8
commit f824fc5243
2 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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());