Skip to content

Commit 5e1ca31

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

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 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
let action = actions.get(req.params.action);
14-
// GOOD: `action` is either the `play` or the `pause` function from above
1514
if (typeof action === 'function') {
16-
res.end(action(req.params.payload));
15+
res.end(action(req.params.payload)); // GOOD: `action` is either the `play` or the `pause` function from above
1716
} else {
1817
res.end("Unsupported action.");
1918
}

0 commit comments

Comments
 (0)