mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-22 09:12:05 -07:00
Merge pull request #52 from christroutner/unstable
fix(rate-limit): Increasing default rate limit to 30 rpm
This commit is contained in:
@@ -15,7 +15,7 @@ const RateLimit = require("express-rate-limit")
|
||||
// Set max requests per minute
|
||||
const maxRequests = process.env.RATE_LIMIT_MAX_REQUESTS
|
||||
? parseInt(process.env.RATE_LIMIT_MAX_REQUESTS)
|
||||
: 20
|
||||
: 30
|
||||
|
||||
// Pro-tier rate limits are 10x the freemium limits.
|
||||
const PRO_RPM = 10 * maxRequests
|
||||
|
||||
@@ -64,7 +64,7 @@ describe("#route-ratelimits", () => {
|
||||
req.path = "/control/getNetworkInfo"
|
||||
req.method = "GET"
|
||||
|
||||
for (let i = 0; i < 25; i++) {
|
||||
for (let i = 0; i < 35; i++) {
|
||||
next.reset() // reset the stubbed next() function.
|
||||
|
||||
await routeRateLimit(req, res, next)
|
||||
@@ -134,7 +134,7 @@ describe("#route-ratelimits", () => {
|
||||
// Prepare the authorization header
|
||||
//req.headers.authorization = generateAuthHeader("BITBOX")
|
||||
|
||||
for (let i = 0; i < 300; i++) {
|
||||
for (let i = 0; i < 400; i++) {
|
||||
next.reset() // reset the stubbed next() function.
|
||||
|
||||
await routeRateLimit(req, res, next)
|
||||
|
||||
Reference in New Issue
Block a user