Fixed output of content_length in access log.

This commit is contained in:
Konstantin Kapustin 2012-09-06 11:51:59 +04:00 committed by benoitc
parent 52c057b92f
commit 238f252a3a

View File

@ -164,7 +164,7 @@ class Logger(object):
'r': "%s %s %s" % (environ['REQUEST_METHOD'],
environ['RAW_URI'], environ["SERVER_PROTOCOL"]),
's': status,
'b': str(resp.response_length) or '-',
'b': resp.response_length and str(resp.response_length) or '-',
'f': environ.get('HTTP_REFERER', '-'),
'a': environ.get('HTTP_USER_AGENT', '-'),
'T': str(request_time.seconds),