check if the auth type is Basic before getting the user name

fix #1148
This commit is contained in:
benoitc 2015-11-20 11:13:44 +01:00
parent fd2350aa4f
commit 38261b5235

View File

@ -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: