From 867cc948068901af0bf5d40d08c71ee3a1ec0e73 Mon Sep 17 00:00:00 2001 From: Patrick Rauscher Date: Sun, 8 Apr 2012 17:48:30 +0000 Subject: [PATCH] bugfix for some crashes through stack overflows --- src/node/hooks/express/apicalls.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node/hooks/express/apicalls.js b/src/node/hooks/express/apicalls.js index 2f9e4edf3..48d507224 100644 --- a/src/node/hooks/express/apicalls.js +++ b/src/node/hooks/express/apicalls.js @@ -10,7 +10,8 @@ var apiCaller = function(req, res, fields) { apiLogger.info("REQUEST, " + req.params.func + ", " + JSON.stringify(fields)); //wrap the send function so we can log the response - res._send = res.send; + //note: res._send seems to be already in use, so better use a "unique" name + res._____send = res.send; res.send = function (response) { response = JSON.stringify(response); apiLogger.info("RESPONSE, " + req.params.func + ", " + response); @@ -19,7 +20,7 @@ var apiCaller = function(req, res, fields) { if(req.query.jsonp) response = req.query.jsonp + "(" + response + ")"; - res._send(response); + res._____send(response); } //call the api handler