Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
fix(config): renew rate-limit if user attempts req in limit time wind…
Browse files Browse the repository at this point in the history
…ow (#509)
  • Loading branch information
Fdawgs committed Feb 23, 2022
1 parent eddd3e4 commit 1204b4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ describe("Configuration", () => {

expect(config.rateLimit).toEqual({
allowList: JSON.parse(RATE_LIMIT_EXCLUDED_ARRAY),
continueExceeding: true,
max: 1000,
timeWindow: 60000,
});
Expand Down Expand Up @@ -224,6 +225,7 @@ describe("Configuration", () => {

expect(config.rateLimit).toEqual({
allowList: JSON.parse(RATE_LIMIT_EXCLUDED_ARRAY),
continueExceeding: true,
max: RATE_LIMIT_MAX_CONNECTIONS_PER_MIN,
timeWindow: 60000,
});
Expand Down
1 change: 1 addition & 0 deletions src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ async function getConfig() {
maxRssBytes: env.PROC_LOAD_MAX_RSS_BYTES || 0,
},
rateLimit: {
continueExceeding: true,
max: env.RATE_LIMIT_MAX_CONNECTIONS_PER_MIN || 1000,
timeWindow: 60000,
},
Expand Down

0 comments on commit 1204b4a

Please sign in to comment.