1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00

simplify client_ip

This commit is contained in:
Florent Daigniere 2021-10-16 09:46:21 +02:00
parent de276a6822
commit abaa2e8cc3

View File

@ -14,7 +14,7 @@ def index():
@ui.route('/login', methods=['GET', 'POST'])
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()
if form.validate_on_submit():
device_cookie, device_cookie_username = utils.limiter.parse_device_cookie(flask.request.cookies.get('rate_limit'))