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