One pass for prepare request and response objects
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user