You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That way you could also properly display all the right HTTP headers. With my solution, when the second-limit blocks the request, the response doesn't include headers about the hourly or daily limits.
My apologies in advance if I've massively over-complicated my solution.
The text was updated successfully, but these errors were encountered:
I want to rate limit my API's login endpoint thusly: max 1 request per second, max 5 requests per hour, max 10 requests per day.
I have implemented it like this using your middleware:
I think it would be practical to add the function
limiter.NewMultipleRates
(or similar) to allow this:That way you could also properly display all the right HTTP headers. With my solution, when the second-limit blocks the request, the response doesn't include headers about the hourly or daily limits.
My apologies in advance if I've massively over-complicated my solution.
The text was updated successfully, but these errors were encountered: