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 25
25
}
26
26
)
27
27
28
+ // DefaultRateLimiterConfig defines default values for RateLimiterConfig
28
29
var DefaultRateLimiterConfig = RateLimiterConfig {
29
30
Skipper : DefaultSkipper ,
30
31
}
@@ -63,9 +64,8 @@ func RateLimiterWithConfig(config RateLimiterConfig) echo.MiddlewareFunc {
63
64
allowed := config .Store .ShouldAllow (identifier )
64
65
if ! allowed {
65
66
return c .JSON (http .StatusTooManyRequests , nil )
66
- } else {
67
- return next (c )
68
67
}
68
+ return next (c )
69
69
}
70
70
}
71
71
}
@@ -78,7 +78,7 @@ type InMemoryStore struct {
78
78
burst int
79
79
}
80
80
81
- // implements TokenStore.ShouldAllow
81
+ // ShouldAllow implements TokenStore.ShouldAllow
82
82
func (store * InMemoryStore ) ShouldAllow (identifier string ) bool {
83
83
store .mutex .Lock ()
84
84
defer store .mutex .Unlock ()
You can’t perform that action at this time.
0 commit comments