simplify client_ip

master
Florent Daigniere 3 years ago
parent de276a6822
commit abaa2e8cc3

@ -14,7 +14,7 @@ def index():
@ui.route('/login', methods=['GET', 'POST']) @ui.route('/login', methods=['GET', 'POST'])
def login(): def login():
client_ip = flask.request.headers["X-Real-IP"] if 'X-Real-IP' in flask.request.headers else flask.request.remote_addr client_ip = flask.request.headers.get('X-Real-IP', flask.request.remote_addr)
form = forms.LoginForm() form = forms.LoginForm()
if form.validate_on_submit(): if form.validate_on_submit():
device_cookie, device_cookie_username = utils.limiter.parse_device_cookie(flask.request.cookies.get('rate_limit')) device_cookie, device_cookie_username = utils.limiter.parse_device_cookie(flask.request.cookies.get('rate_limit'))

Loading…
Cancel
Save