mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Merge pull request #613 from prauscher/fix-apicall
bugfix for some crashes through stack overflows
This commit is contained in:
commit
4e1a088d22
1 changed files with 3 additions and 2 deletions
|
@ -10,7 +10,8 @@ var apiCaller = function(req, res, fields) {
|
||||||
apiLogger.info("REQUEST, " + req.params.func + ", " + JSON.stringify(fields));
|
apiLogger.info("REQUEST, " + req.params.func + ", " + JSON.stringify(fields));
|
||||||
|
|
||||||
//wrap the send function so we can log the response
|
//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) {
|
res.send = function (response) {
|
||||||
response = JSON.stringify(response);
|
response = JSON.stringify(response);
|
||||||
apiLogger.info("RESPONSE, " + req.params.func + ", " + response);
|
apiLogger.info("RESPONSE, " + req.params.func + ", " + response);
|
||||||
|
@ -19,7 +20,7 @@ var apiCaller = function(req, res, fields) {
|
||||||
if(req.query.jsonp)
|
if(req.query.jsonp)
|
||||||
response = req.query.jsonp + "(" + response + ")";
|
response = req.query.jsonp + "(" + response + ")";
|
||||||
|
|
||||||
res._send(response);
|
res._____send(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
//call the api handler
|
//call the api handler
|
||||||
|
|
Loading…
Reference in a new issue