mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
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:
@@ -5,6 +5,7 @@
|
||||
* Support for many frameworks and libraries has been improved, in particular including the following:
|
||||
- [a-sync-waterfall](https://www.npmjs.com/package/a-sync-waterfall)
|
||||
- [Electron](https://electronjs.org)
|
||||
- [Express](https://npmjs.org/express)
|
||||
- [hapi](https://hapijs.com/)
|
||||
- [js-cookie](https://github.com/js-cookie/js-cookie)
|
||||
- [React](https://reactjs.org/)
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user