File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ module.exports = {
240240 ) ;
241241 }
242242
243- // Validate T (period) - must be positive integer >= 60
243+ // Validate T (period) - must be positive integer >= 60 (1 minute)
244244 if ( typeof T !== 'number' || ! Number . isInteger ( T ) || T < 60 ) {
245245 throw new UserInputError (
246246 'Invalid rate limit period. Must be a positive integer greater than or equal to 60 seconds.'
@@ -249,7 +249,7 @@ module.exports = {
249249
250250 // Validate reasonable maximums (prevent extremely large values)
251251 const MAX_THRESHOLD = 1000000000 ; // 1 billion
252- const MAX_PERIOD = 2678400 ; // 1 month in seconds
252+ const MAX_PERIOD = 60 * 60 * 24 * 31 ; // 1 month in seconds
253253
254254 if ( N > MAX_THRESHOLD ) {
255255 throw new UserInputError (
@@ -259,7 +259,7 @@ module.exports = {
259259
260260 if ( T > MAX_PERIOD ) {
261261 throw new UserInputError (
262- `Rate limit period cannot exceed ${ MAX_PERIOD . toLocaleString ( ) } seconds (1 year ).`
262+ `Rate limit period cannot exceed ${ MAX_PERIOD . toLocaleString ( ) } seconds (1 month ).`
263263 ) ;
264264 }
265265 }
You can’t perform that action at this time.
0 commit comments