Server: Fix failed login attempts using digest auth not being logged to the main log

This commit is contained in:
Kovid Goyal 2017-07-27 09:31:35 +05:30
parent 5b6482c3c9
commit f838e6c3a4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 5 deletions

View File

@ -238,8 +238,7 @@ class AuthController(object):
if not nonce_is_stale: if not nonce_is_stale:
data.username = da.username data.username = da.username
return return
else: log_msg = 'Failed login attempt from: %s' % data.remote_addr
log_msg = 'Failed login attempt from: %s' % data.remote_addr
elif self.prefer_basic_auth and scheme == 'basic': elif self.prefer_basic_auth and scheme == 'basic':
try: try:
un, pw = base64_decode(rest.strip()).partition(':')[::2] un, pw = base64_decode(rest.strip()).partition(':')[::2]
@ -250,8 +249,7 @@ class AuthController(object):
if self.check(un, pw): if self.check(un, pw):
data.username = un data.username = un
return return
else: log_msg = 'Failed login attempt from: %s' % data.remote_addr
log_msg = 'Failed login attempt from: %s' % data.remote_addr
else: else:
raise HTTPSimpleResponse(httplib.BAD_REQUEST, 'Unsupported authentication method') raise HTTPSimpleResponse(httplib.BAD_REQUEST, 'Unsupported authentication method')

View File

@ -551,7 +551,7 @@ class HTTPConnection(HTTPRequest):
return return
if isinstance(output, ReadableOutput): if isinstance(output, ReadableOutput):
self.use_sendfile = output.use_sendfile and self.opts.use_sendfile and sendfile_to_socket_async is not None and self.ssl_context is None self.use_sendfile = output.use_sendfile and self.opts.use_sendfile and sendfile_to_socket_async is not None and self.ssl_context is None
# sendfile() does nto work with SSL sockets since encryption has to # sendfile() does not work with SSL sockets since encryption has to
# be done in userspace # be done in userspace
if output.ranges is not None: if output.ranges is not None:
if isinstance(output.ranges, Range): if isinstance(output.ranges, Range):