go-chi / httprate

net/http rate limiter middleware
MIT License
270 stars 18 forks source link

Pass windowLength to LimitCounter.Increment() #14

Closed FlatMapIO closed 2 years ago

FlatMapIO commented 2 years ago

LimitCounter requireswindowLength to determine whether to evict the key expired. The external counter implementation needs to hold the same duplicatewindowLength as the Limit(_ , windowLength)

pkieltyka commented 2 years ago

Done in https://github.com/go-chi/httprate/commit/7d704b44c6fc321fc44dc67fbcfe83473990dd8a

added Config(..)