Skip to content

Commit

Permalink
only override config when value lower than zero
Browse files Browse the repository at this point in the history
  • Loading branch information
ad3n committed Jan 23, 2025
1 parent 23dc2b4 commit 9c350c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware/limiter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func configDefault(config ...Config) Config {
if cfg.Max < 0 {
cfg.Max = ConfigDefault.Max
}
if int(cfg.Expiration.Seconds()) < 0 {
if int(cfg.Expiration.Seconds()) <= 0 {
cfg.Expiration = ConfigDefault.Expiration
}
if cfg.KeyGenerator == nil {
Expand Down

0 comments on commit 9c350c3

Please sign in to comment.