From 4578f6016b04a6e850bfe6076f12dd3757164e96 Mon Sep 17 00:00:00 2001 From: lanf0n Date: Fri, 13 Oct 2017 16:48:02 +0800 Subject: [PATCH] to fix condition error that used in `log_response` `request` class is derived from `dict`, so it will never be `True`. --- sanic/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanic/server.py b/sanic/server.py index 8f60a864..2d47dc4f 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -311,7 +311,7 @@ class HttpProtocol(asyncio.Protocol): else: extra['byte'] = -1 - if self.request: + if self.request is not None: extra['host'] = '{0}:{1}'.format(self.request.ip[0], self.request.ip[1]) extra['request'] = '{0} {1}'.format(self.request.method,