From 9c1ed1038949296e996c7ed38ff5e5d5ff36ae6e Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Fri, 4 Jan 2019 21:03:31 +0100 Subject: [PATCH] Don't crash on authenticaiton with colon in the password It's supposed to be archives/antispam, but if a password with an actual colon sign in it was used, it'd crash instead of asking for auth again. --- django/archives/mailarchives/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/archives/mailarchives/views.py b/django/archives/mailarchives/views.py index dfb4874..6ed715b 100644 --- a/django/archives/mailarchives/views.py +++ b/django/archives/mailarchives/views.py @@ -123,7 +123,7 @@ def antispam_auth(fn): if len(auth) != 2: return HttpResponseForbidden("Invalid authentication") if auth[0].lower() == "basic": - user, pwd = base64.b64decode(auth[1]).decode('utf8', errors='ignore').split(':') + user, pwd = base64.b64decode(auth[1]).decode('utf8', errors='ignore').split(':', 1) if user == 'archives' and pwd == 'antispam': # Actually run the function if auth is correct resp = fn(request, *_args, **_kwargs) -- 2.39.5