From 38261b523560caa71ce35d65750dd6ceae3f41c5 Mon Sep 17 00:00:00 2001 From: benoitc Date: Fri, 20 Nov 2015 11:13:44 +0100 Subject: [PATCH] check if the auth type is Basic before getting the user name fix #1148 --- gunicorn/glogging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/glogging.py b/gunicorn/glogging.py index 3a4ba686..d8241449 100644 --- a/gunicorn/glogging.py +++ b/gunicorn/glogging.py @@ -381,7 +381,7 @@ class Logger(object): def _get_user(self, environ): user = None http_auth = environ.get("HTTP_AUTHORIZATION") - if http_auth: + if http_auth and http_auth.startswith('Basic'): auth = http_auth.split(" ", 1) if len(auth) == 2: try: