File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 44from flask import current_app , json
55from os import environ as env
66
7+ from flask_limiter .util import get_remote_address
78from helpers import respond
89from flask import Blueprint , abort , jsonify , request
910from werkzeug .exceptions import HTTPException
@@ -565,7 +566,8 @@ def after_request(response):
565566# https://flask-limiter.readthedocs.io/en/stable/#custom-rate-limit-exceeded-responses
566567@blueprint .errorhandler (429 )
567568def ratelimit_handler (e ):
568- print (e )
569+ current_app .logger .warning (e )
570+ current_app .logger .warning ("User at address " + get_remote_address () + "exceeded rate limit of " + e .description )
569571 return respond (
570572 make_error_object (429 , title = "Ratelimit Exceeded" ,
571573 message = "ratelimit of " + e .description + " exceeded" ),
You can’t perform that action at this time.
0 commit comments