Merge pull request #10 from rysiekpl/master

Minor bugfixes
This commit is contained in:
Vladimir Homutov 2016-10-10 23:53:52 +04:00 committed by GitHub
commit 40fc2ef257
1 changed files with 2 additions and 2 deletions

View File

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