Skip to content

Commit 5121414

Browse files
Update javascript/ql/test/query-tests/Security/CWE-754/UnvalidatedDynamicMethodCallGood4.js
Co-authored-by: Erik Krogh Kristensen <[email protected]>
1 parent 9809d30 commit 5121414

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

javascript/ql/test/query-tests/Security/CWE-754/UnvalidatedDynamicMethodCallGood4.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ actions.put("pause", function pause(data) {
1111

1212
app.get('/perform/:action/:payload', function(req, res) {
1313
if (typeof actions.get(req.params.action) === 'function') {
14-
let action = actions.get(req.params.action); // OK but flagged [INCONSISTENCY]
15-
// GOOD: `action` is either the `play` or the `pause` function from above
16-
res.end(action(req.params.payload));
14+
let action = actions.get(req.params.action);
15+
res.end(action(req.params.payload)); // OK but flagged [INCONSISTENCY]. `action` is either the `play` or the `pause` function from above
1716
} else {
1817
res.end("Unsupported action.");
1918
}

0 commit comments

Comments
 (0)