From 38ea029bd9b118e58627055a900ae8357e9e48e5 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Thu, 8 Aug 2024 10:27:35 +0200 Subject: [PATCH] Better --- core/admin/mailu/internal/views/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/admin/mailu/internal/views/auth.py b/core/admin/mailu/internal/views/auth.py index 3182188c..fed10953 100644 --- a/core/admin/mailu/internal/views/auth.py +++ b/core/admin/mailu/internal/views/auth.py @@ -49,7 +49,7 @@ def nginx_authentication(): if not is_port_25: utils.limiter.exempt_ip_from_ratelimits(client_ip) elif is_valid_user: - password = urllib.parse.unquote(headers['Auth-Pass']) if 'Auth-Pass' in headers else '' + password = urllib.parse.unquote(headers.get('Auth-Pass'], None)) utils.limiter.rate_limit_user(username, client_ip, password=password) elif not is_from_webmail: utils.limiter.rate_limit_ip(client_ip, username)