mirror of
https://github.com/Mailu/Mailu.git
synced 2024-12-12 10:45:38 +02:00
as per review
This commit is contained in:
parent
98f671dc2e
commit
78c5d34227
@ -98,7 +98,7 @@ def handle_authentication(headers):
|
|||||||
password = urllib.parse.unquote(headers["Auth-Pass"])
|
password = urllib.parse.unquote(headers["Auth-Pass"])
|
||||||
ip = urllib.parse.unquote(headers["Client-Ip"])
|
ip = urllib.parse.unquote(headers["Client-Ip"])
|
||||||
except:
|
except:
|
||||||
app.logger.warn(f'Received undecodable user/password from nginx: {headers["Auth-User"]!r}/{headers["Auth-Pass"]!r}')
|
app.logger.warn(f'Received undecodable user/password from nginx: {headers.get("Auth-User", "")!r}')
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
user = models.User.query.get(user_email) if '@' in user_email else None
|
user = models.User.query.get(user_email) if '@' in user_email else None
|
||||||
|
@ -49,7 +49,7 @@ def nginx_authentication():
|
|||||||
if not is_port_25:
|
if not is_port_25:
|
||||||
utils.limiter.exempt_ip_from_ratelimits(client_ip)
|
utils.limiter.exempt_ip_from_ratelimits(client_ip)
|
||||||
elif is_valid_user:
|
elif is_valid_user:
|
||||||
password = urllib.parse.unquote(headers.get('Auth-Pass', None))
|
password = urllib.parse.unquote(headers.get('Auth-Pass', ''))
|
||||||
utils.limiter.rate_limit_user(username, client_ip, password=password)
|
utils.limiter.rate_limit_user(username, client_ip, password=password)
|
||||||
elif not is_from_webmail:
|
elif not is_from_webmail:
|
||||||
utils.limiter.rate_limit_ip(client_ip, username)
|
utils.limiter.rate_limit_ip(client_ip, username)
|
||||||
|
Loading…
Reference in New Issue
Block a user