clean codes

This commit is contained in:
lixxu 2017-11-28 14:47:43 +08:00
parent f50a37fc88
commit 283762224c

View File

@ -315,8 +315,7 @@ class HttpProtocol(asyncio.Protocol):
extra['host'] = 'UNKNOWN'
if self.request is not None:
if self.request.ip:
extra['host'] = '{0}:{1}'.format(self.request.ip[0],
self.request.ip[1])
extra['host'] = '{0[0]}:{0[1]}'.format(self.request.ip)
extra['request'] = '{0} {1}'.format(self.request.method,
self.request.url)