Merge pull request #1006 from asger-semmle/express-end

JS: Treat res.end() as alias for res.send() in Express
This commit is contained in:
Max Schaefer
2019-03-01 10:30:06 +00:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -604,14 +604,15 @@ module Express {
}
/**
* An argument passed to the `send` method of an HTTP response object.
* An argument passed to the `send` or `end` method of an HTTP response object.
*/
private class ResponseSendArgument extends HTTP::ResponseSendArgument {
RouteHandler rh;
ResponseSendArgument() {
exists(MethodCallExpr mce |
mce.calls(rh.getAResponseExpr(), "send") and
exists(MethodCallExpr mce, string name |
mce.calls(rh.getAResponseExpr(), name) and
(name = "send" or name = "end") and
this = mce.getArgument(0)
)
}