From 2f310a15bdd26bfa947aa497c165976a12c37f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Mart=C3=ADn?= Date: Thu, 5 Oct 2017 17:23:07 +0200 Subject: [PATCH] do not overwrite creation of res.locals --- lib/cartodb/middleware/context/layergroup-token.js | 2 +- lib/cartodb/server.js | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/cartodb/middleware/context/layergroup-token.js b/lib/cartodb/middleware/context/layergroup-token.js index 63524942..026d0806 100644 --- a/lib/cartodb/middleware/context/layergroup-token.js +++ b/lib/cartodb/middleware/context/layergroup-token.js @@ -1,7 +1,7 @@ var LayergroupToken = require('../../models/layergroup-token'); module.exports = function layergroupTokenMiddleware(req, res, next) { - if (!res.locals.hasOwnProperty('token')) { + if (!res.locals.token) { return next(); } diff --git a/lib/cartodb/server.js b/lib/cartodb/server.js index 44be69a1..ffd7efda 100644 --- a/lib/cartodb/server.js +++ b/lib/cartodb/server.js @@ -369,8 +369,6 @@ function bootstrap(opts) { app.use(bodyParser.json()); app.use(function bootstrap$prepareRequestResponse(req, res, next) { - res.locals = {}; - req.profiler = new Profiler({ statsd_client: global.statsClient, profile: opts.useProfiler