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
I'm building an API with throttling and the API has well educated clients, that can respect the X-RateLimit headers. I haven't found a way to do this in the rack-attack gem. Is there an interest in this feature for throttling? I can develop, but was just wondering if it's desirable to the gem.
Good question, @gvc. It's pretty easy to figure out what to put in the X-RateLimit response header by inspecting the annotated environment.
Check out a request's env['rack.attack.throttle_data']. It's a hash of throttles the request matched (but didn't necessarily exceed); and the count, period, and limit of the throttle. It's set here.
I'm building an API with throttling and the API has well educated clients, that can respect the X-RateLimit headers. I haven't found a way to do this in the rack-attack gem. Is there an interest in this feature for throttling? I can develop, but was just wondering if it's desirable to the gem.
Many APIs are using this already:
http://developer.github.com/v3/#rate-limiting
http://developer.vimeo.com/guidelines/rate-limiting
https://dev.twitter.com/docs/rate-limiting/1.1
Looking forward for your feedback.
The text was updated successfully, but these errors were encountered: