mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
JS: Add test for fastify-rate-limit
This commit is contained in:
@@ -8,3 +8,4 @@
|
||||
| tst.js:38:20:38:36 | expensiveHandler4 | This route handler performs $@, but is not rate-limited. | tst.js:17:40:17:83 | connect ... ution') | a database access |
|
||||
| tst.js:64:25:64:63 | functio ... req); } | This route handler performs $@, but is not rate-limited. | tst.js:64:46:64:60 | verifyUser(req) | authorization |
|
||||
| tst.js:76:25:76:53 | catchAs ... ndler1) | This route handler performs $@, but is not rate-limited. | tst.js:14:40:14:46 | login() | authorization |
|
||||
| tst.js:88:24:88:40 | expensiveHandler1 | This route handler performs $@, but is not rate-limited. | tst.js:14:40:14:46 | login() | authorization |
|
||||
|
||||
@@ -82,3 +82,9 @@ function errorHandler(req, res, next) {
|
||||
next(makeOAuthError(req, res));
|
||||
}
|
||||
express().use(errorHandler); // OK - does not perform authentication
|
||||
|
||||
const fastifyApp = require('fastify')();
|
||||
|
||||
fastifyApp.get('/foo', expensiveHandler1); // NOT OK
|
||||
fastifyApp.register(require('fastify-rate-limit'));
|
||||
fastifyApp.get('/bar', expensiveHandler1); // OK
|
||||
|
||||
Reference in New Issue
Block a user