From b92ced7d1ab0239417557ba2a51cb3fbd8841e0a Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 25 Feb 2023 21:41:51 +0100 Subject: [PATCH] fix(backend): add default limiter to rate limiter --- backend/server/rate/rate.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/server/rate/rate.go b/backend/server/rate/rate.go index d65c90f..826cc8b 100644 --- a/backend/server/rate/rate.go +++ b/backend/server/rate/rate.go @@ -29,8 +29,9 @@ type scopedLimiter struct { func NewLimiter(defaultLimit int, windowLength time.Duration, options ...httprate.Option) *Limiter { return &Limiter{ - windowLength: windowLength, - options: options, + windowLength: windowLength, + options: options, + defaultLimiter: httprate.Limit(defaultLimit, windowLength, options...), } }