Minor bugfixes: password can now contain colons, log_message uses self.ctx (instead of global ctx, which does not exist)

This commit is contained in:
Michał 'rysiek' Woźniak 2016-10-10 21:38:15 +02:00
parent c61f0137b7
commit 24bf24ffbb
1 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ class AuthHandler(BaseHTTPRequestHandler):
try:
auth_decoded = base64.b64decode(auth_header[6:])
user, passwd = auth_decoded.split(':', 2)
user, passwd = auth_decoded.split(':', 1)
except:
self.auth_failed(ctx)
@ -131,7 +131,7 @@ class AuthHandler(BaseHTTPRequestHandler):
if not hasattr(self, 'ctx'):
user = '-'
else:
user = ctx['user']
user = self.ctx['user']
sys.stdout.write("%s - %s [%s] %s\n" % (addr, user,
self.log_date_time_string(), format % args))