mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Merge pull request #3314 from rhelmer/sanitize-jsonp
better sanitize jsonp
This commit is contained in:
commit
626e58cc5a
2 changed files with 3 additions and 2 deletions
|
@ -18,7 +18,7 @@ var apiCaller = function(req, res, fields) {
|
||||||
apiLogger.info("RESPONSE, " + req.params.func + ", " + response);
|
apiLogger.info("RESPONSE, " + req.params.func + ", " + response);
|
||||||
|
|
||||||
//is this a jsonp call, if yes, add the function call
|
//is this a jsonp call, if yes, add the function call
|
||||||
if(req.query.jsonp)
|
if(req.query.jsonp && isVarName(response))
|
||||||
response = req.query.jsonp + "(" + response + ")";
|
response = req.query.jsonp + "(" + response + ")";
|
||||||
|
|
||||||
res._____send(response);
|
res._____send(response);
|
||||||
|
|
|
@ -43,7 +43,8 @@
|
||||||
"jsonminify" : "0.4.1",
|
"jsonminify" : "0.4.1",
|
||||||
"measured" : "1.1.0",
|
"measured" : "1.1.0",
|
||||||
"mocha" : "2.4.5",
|
"mocha" : "2.4.5",
|
||||||
"supertest" : "1.2.0"
|
"supertest" : "1.2.0",
|
||||||
|
"is-var-name" : "1.0.0"
|
||||||
},
|
},
|
||||||
"bin": { "etherpad-lite": "./node/server.js" },
|
"bin": { "etherpad-lite": "./node/server.js" },
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
Loading…
Reference in a new issue