mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Update javascript/ql/test/query-tests/Security/CWE-754/UnvalidatedDynamicMethodCallGood3.js
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
This commit is contained in:
@@ -11,9 +11,8 @@ actions.put("pause", function pause(data) {
|
||||
|
||||
app.get('/perform/:action/:payload', function(req, res) {
|
||||
let action = actions.get(req.params.action);
|
||||
// GOOD: `action` is either the `play` or the `pause` function from above
|
||||
if (typeof action === 'function') {
|
||||
res.end(action(req.params.payload));
|
||||
res.end(action(req.params.payload)); // GOOD: `action` is either the `play` or the `pause` function from above
|
||||
} else {
|
||||
res.end("Unsupported action.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user