File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ const serverConfigSchema = domainConfigSchema.extend({
4848 UNIT_MODE : z . enum ( [ 'cu' , 'ru' ] ) ,
4949 port : positiveIntSchema ,
5050 ENABLE_METRICS_ENDPOINT : z . preprocess ( ( val ) => ! ! val , z . boolean ( ) ) ,
51- /**
51+ /**
5252 * Rate limiting settings
5353 */
5454 RATE_LIMIT_WINDOW : positiveIntSchema ,
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ export const withDryRunRoutes = app => {
3939 domain : { BUSY_THRESHOLD , apis : { dryRun } }
4040 } = req
4141
42- if ( req . limitRequest ( req ) ) {
43- res . status ( 429 ) . send ( { ' error' : 'Rate limit exceeded' } )
42+ if ( req . limitRequest ( req ) ) {
43+ res . status ( 429 ) . send ( { error : 'Rate limit exceeded' } )
4444 return
4545 }
4646
@@ -55,7 +55,7 @@ export const withDryRunRoutes = app => {
5555 }
5656 ) . then ( ( output ) => {
5757 res . send ( output . result )
58- if ( ! output . wasCached ) {
58+ if ( ! output . wasCached ) {
5959 req . recordRequest ( req )
6060 }
6161 } )
Original file line number Diff line number Diff line change @@ -23,11 +23,11 @@ export const createRateLimitMiddleware = (config) => {
2323 const RATE_LIMIT_MAX_REQUESTS = config . RATE_LIMIT_MAX_REQUESTS
2424 const RATE_LIMIT_CLEANUP_INTERVAL = config . RATE_LIMIT_CLEANUP_INTERVAL
2525
26- if ( ! RATE_LIMIT_WINDOW || ! RATE_LIMIT_MAX_REQUESTS || ! RATE_LIMIT_CLEANUP_INTERVAL ) {
26+ if ( ! RATE_LIMIT_WINDOW || ! RATE_LIMIT_MAX_REQUESTS || ! RATE_LIMIT_CLEANUP_INTERVAL ) {
2727 return ( handler ) => ( req , res ) => {
28- req . recordRequest = ( ) => { }
29- req . limitRequest = ( ) => { }
30- return handler ( req , res )
28+ req . recordRequest = ( ) => { }
29+ req . limitRequest = ( ) => { }
30+ return handler ( req , res )
3131 }
3232 }
3333
@@ -91,4 +91,4 @@ export const createRateLimitMiddleware = (config) => {
9191 req . limitRequest = limitRequest
9292 return handler ( req , res )
9393 }
94- }
94+ }
You can’t perform that action at this time.
0 commit comments