mirror of
https://github.com/Mailu/Mailu.git
synced 2025-03-03 14:52:36 +02:00
simplify the Auth-Status check
This commit is contained in:
parent
2dd9ea1506
commit
3bda8368e4
@ -36,9 +36,9 @@ def nginx_authentication():
|
||||
response.headers['Auth-Wait'] = '3'
|
||||
return response
|
||||
is_valid_user = True
|
||||
if ("Auth-Status" not in headers) or (headers["Auth-Status"] != "OK"):
|
||||
if headers.get('Auth-Status') != 'OK':
|
||||
utils.limiter.rate_limit_user(username, client_ip) if is_valid_user else rate_limit_ip(client_ip)
|
||||
elif ("Auth-Status" in headers) and (headers["Auth-Status"] == "OK"):
|
||||
elif headers["Auth-Status"] == "OK":
|
||||
utils.limiter.exempt_ip_from_ratelimits(client_ip)
|
||||
return response
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user