Skip to content

Commit bfbe70a

Browse files
committed
JS: Fixes
1 parent 82d3a7e commit bfbe70a

File tree

3 files changed

+64
-44
lines changed

3 files changed

+64
-44
lines changed

javascript/ql/src/semmle/javascript/frameworks/ConnectExpressShared.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ module ConnectExpressShared {
4141
result = "request,response,next,parameter"
4242
}
4343

44+
/** Gets the signature corresonding to `(req, res, next) => {...}`. */
45+
RouteHandlerSignature requestResponseNext() {
46+
result = "request,response,next"
47+
}
48+
4449
/** Gets the signature corresonding to `(err, req, res, next) => {...}`. */
4550
RouteHandlerSignature errorRequestResponseNext() { result = "error,request,response,next" }
4651
}
@@ -99,8 +104,7 @@ module ConnectExpressShared {
99104
kind)
100105
else
101106
result =
102-
getRouteHandlerParameter(routeHandler,
103-
RouteHandlerSignature::requestResponseNextParameter(), kind)
107+
getRouteHandlerParameter(routeHandler, RouteHandlerSignature::requestResponseNext(), kind)
104108
}
105109

106110
/**

javascript/ql/test/library-tests/frameworks/Express/src/params.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ var express = require('express');
22
var app = express();
33

44
app.param('foo', (req, res, next, value) => {
5+
console.log(req.query.xx);
6+
console.log(req.body.xx);
57
if (value) {
68
res.send(value);
79
} else {

0 commit comments

Comments
 (0)