Fix request rate limit option not working

This commit is contained in:
Ajay
2022-10-27 20:00:04 -04:00
parent ccd1321d24
commit 96db571a5e
2 changed files with 2 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ function setupRoutes(router: Router) {
// Rate limit endpoint lists
const voteEndpoints: RequestHandler[] = [voteOnSponsorTime];
const viewEndpoints: RequestHandler[] = [viewedVideoSponsorTime];
if (config.rateLimit) {
if (config.rateLimit && config.redisRateLimit) {
if (config.rateLimit.vote) voteEndpoints.unshift(rateLimitMiddleware(config.rateLimit.vote, voteGetUserID));
if (config.rateLimit.view) viewEndpoints.unshift(rateLimitMiddleware(config.rateLimit.view));
}