Merge pull request #160 from ajayyy/experimental

Fix example error codes
This commit is contained in:
Ajay Ramachandran
2020-10-11 13:36:11 -04:00
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@@ -28,7 +28,7 @@
"windowMs": 900000, // 15 minutes "windowMs": 900000, // 15 minutes
"max": 20, // 20 requests in 15min time window "max": 20, // 20 requests in 15min time window
"message": "Too many votes, please try again later", "message": "Too many votes, please try again later",
"statusCode": 200 "statusCode": 429
}, },
"view": { "view": {
"windowMs": 900000, // 15 minutes "windowMs": 900000, // 15 minutes

View File

@@ -38,7 +38,7 @@ var oldSubmitSponsorTimes = require('./routes/oldSubmitSponsorTimes.js');
let voteEndpoints = [voteOnSponsorTime.endpoint]; let voteEndpoints = [voteOnSponsorTime.endpoint];
let viewEndpoints = [viewedVideoSponsorTime]; let viewEndpoints = [viewedVideoSponsorTime];
if (config.rateLimit) { if (config.rateLimit) {
// if (config.rateLimit.vote) voteEndpoints.unshift(rateLimitMiddleware(config.rateLimit.vote)); if (config.rateLimit.vote) voteEndpoints.unshift(rateLimitMiddleware(config.rateLimit.vote));
if (config.rateLimit.view) viewEndpoints.unshift(rateLimitMiddleware(config.rateLimit.view)); if (config.rateLimit.view) viewEndpoints.unshift(rateLimitMiddleware(config.rateLimit.view));
} }

View File

@@ -55,12 +55,12 @@
"windowMs": 900000, "windowMs": 900000,
"max": 20, "max": 20,
"message": "Too many votes, please try again later", "message": "Too many votes, please try again later",
"statusCode": 200 "statusCode": 429
}, },
"view": { "view": {
"windowMs": 900000, "windowMs": 900000,
"max": 20, "max": 20,
"statusCode": 200 "statusCode": 200
} }
} }
} }