No need to pass a reference to itself

This commit is contained in:
Raul Ochoa 2015-07-13 15:06:22 +02:00
parent 96a6a0d980
commit 76823f7529

View File

@ -257,8 +257,6 @@ module.exports = function(serverOptions) {
];
app.sendResponse = function(res, args) {
var that = this;
var statusCode;
if ( res._windshaftStatusCode ) {
// Added by our override of sendError
@ -294,7 +292,7 @@ module.exports = function(serverOptions) {
}
//console.log("Adding cache channel to route\n" + req.route.path + " not matching any in:\n" +
// mapCreateRoutes.join("\n"));
app.addCacheChannel(that, req, this);
app.addCacheChannel(req, this);
},
function sendResponse(err/*, added*/) {
if ( err ) console.log(err + err.stack);
@ -579,7 +577,7 @@ module.exports = function(serverOptions) {
// @param cb function(err, channel) will be called when ready.
// the channel parameter will be null if nothing was added
//
app.addCacheChannel = function(app, req, cb) {
app.addCacheChannel = function(req, cb) {
// skip non-GET requests, or requests for which there's no response
if ( req.method != 'GET' || ! req.res ) { cb(null, null); return; }
if (req.profiler) {