Skip to content

Commit

Permalink
Add versionadded in docs for on_breach custom responses
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaifee committed Aug 10, 2022
1 parent d5a7e94 commit 43cab08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/source/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ json response instead::
, 429
)

.. versionadded:: 2.6.0

The same effect can be achieved by using the :paramref:`~Limiter.on_breach` parameter
when initializing the :class:`Limiter`. If the callback passed to this parameter
returns an instance of :class:`~flask.Response` that response will be the one embedded
Expand Down Expand Up @@ -109,6 +111,8 @@ For example::

For specific rate limit decorated routes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. versionadded:: 2.6.0

If the objective is to only customize rate limited error responses for certain
rate limited routes this can be achieved in a similar manner as above,
through the :paramref:`~Limiter.limit.on_breach` parameter of the rate limit decorator.
Expand Down

0 comments on commit 43cab08

Please sign in to comment.