обавлен эндпоинт /rate для отображения страницы с ограничением частоты запросов
This commit is contained in:
parent
4c640798a9
commit
273eec2726
8
app.py
8
app.py
@ -769,6 +769,14 @@ def ads_txt():
|
||||
def logo():
|
||||
return send_file(app_path+"/static/favicon.ico")
|
||||
|
||||
@app.route('/rate')
|
||||
def rate_limit():
|
||||
try:
|
||||
return render_template('rate_limit.html', site=site)
|
||||
except:
|
||||
app.logger.error(traceback.format_exc())
|
||||
return 'bad request!', 500
|
||||
|
||||
|
||||
def get_ip(req) -> str:
|
||||
if 'X-Forwarded-For' in req.headers:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user