One pass for prepare request and response objects

This commit is contained in:
Raul Ochoa
2015-07-10 11:25:20 +02:00
parent 9bece712a9
commit 1e52f790ad

View File

@@ -811,17 +811,13 @@ function bootstrap(opts) {
app.enable('jsonp callback');
app.use(express.bodyParser());
app.use(function createRequestContext(req, res, next) {
app.use(function bootstrap$prepareRequestResponse(req, res, next) {
req.context = req.context || {};
next();
});
// Use our step-profiler
app.use(function(req, res, next) {
req.profiler = new windshaft.stats.Profiler({
statsd_client: global.statsClient,
profile: opts.useProfiler
});
res.removeHeader('x-powered-by');
next();
});