Skip to content

Commit

Permalink
Merge pull request #85 from eco-stake/force-rate-limit-domains
Browse files Browse the repository at this point in the history
Force rate limiting of certain domains
  • Loading branch information
tombeynon committed Jun 24, 2024
2 parents d0ac878 + e412914 commit 1d04531
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions status/healthMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ function HealthMonitor() {
errorCount = 0;
}
}
// Force rate limiting of certain problematic domains
const RATE_LIMITED_DOMAINS = ['publicnode.com', 'pupmos.network']
const hostname = new URL(finalAddress).hostname
if(RATE_LIMITED_DOMAINS.some(domain => hostname.includes(domain))){
rateLimitedAt = Date.now()
}
}
rateLimited = rateLimitedAt && rateLimitedAt > Date.now() - 1000 * RATE_LIMIT_COOLDOWN

Expand Down

0 comments on commit 1d04531

Please sign in to comment.