mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-22 01:02:05 -07:00
fix(rate limits): Duration was set to 1 second, not 1 minute. Fixed
This commit is contained in:
@@ -26,7 +26,7 @@ const { RateLimiterRedis } = require('rate-limiter-flexible')
|
||||
const rateLimitOptions = {
|
||||
storeClient: redisClient,
|
||||
points: 100, // Number of points
|
||||
duration: 1 // Per second
|
||||
duration: 60 // Per second
|
||||
}
|
||||
|
||||
// This hard-coded value is temporary. It will be swapped out with an environment
|
||||
|
||||
@@ -94,6 +94,8 @@ describe('#route-ratelimits & jwt-auth', () => {
|
||||
let routeRateLimit = rateLimitMiddleware.routeRateLimit
|
||||
// const getInfo = controlRoute.testableComponents.getInfo
|
||||
|
||||
// NOTE: this test will fail if you run multiple integration tests in a
|
||||
// short period. Because it talks to the Redis DB.
|
||||
it('should pass through rate-limit middleware', async () => {
|
||||
req.baseUrl = '/v3'
|
||||
req.path = '/control/getNetworkInfo'
|
||||
@@ -433,6 +435,8 @@ describe('#route-ratelimits & jwt-auth', () => {
|
||||
})
|
||||
|
||||
describe('#rateLimitByResource', () => {
|
||||
// NOTE: this test will fail if you run multiple integration tests in a
|
||||
// short period. Because it talks to the Redis DB.
|
||||
it('should pass through rate-limit middleware', async () => {
|
||||
req.baseUrl = '/v3'
|
||||
req.path = '/control/getNetworkInfo'
|
||||
|
||||
Reference in New Issue
Block a user