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
Prior to this commit, the default behavior for exceeding a rate limit
involved responding with a status of [429 Too many requests][]. The only
indication that a rate limit was exceeded was the `429` code.
This commit changes the default behavior from a `head :too_many_requests`
call to instead raise a new `ActionController::TooManyRequests` error.
This change adheres more closely to precedent established by other
status codes like `ActionController::BadRequest` to a `:bad_request`
(`400 Bad Request`) status, or `ActiveRecord::RecordNotFound` to a
`:not_found` (`404 Not Found`) status.
Application-side controllers can be configured to `rescue_from` that
exception, or they can rely on a new
`ActionController::TooManyRequests`-to-`429 Too many requests` status
mapping entry in the `ActionDispatch/Middleware/ExceptionWrapper`
error-to-status mapping.
[429 Too many requests]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/429
0 commit comments