flake8 fix

This commit is contained in:
Yun Xu 2017-07-14 17:23:18 -07:00
parent 75378d3567
commit 198bf55b7b

View File

@ -168,7 +168,9 @@ class Request(dict):
if not hasattr(self, '_remote_addr'): if not hasattr(self, '_remote_addr'):
forwarded_for = self.headers.get('X-Forwarded-For', '').split(',') forwarded_for = self.headers.get('X-Forwarded-For', '').split(',')
remote_addrs = [ remote_addrs = [
addr for addr in [addr.strip() for addr in forwarded_for] if addr addr for addr in [
addr.strip() for addr in forwarded_for
] if addr
] ]
if len(remote_addrs) > 0: if len(remote_addrs) > 0:
self._remote_addr = remote_addrs[0] self._remote_addr = remote_addrs[0]