Merge pull request #52 from christroutner/unstable

fix(rate-limit): Increasing default rate limit to 30 rpm
This commit is contained in:
Chris Troutner
2019-10-12 16:25:03 -07:00
committed by GitHub
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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)