Merge pull request #301 from r0fls/cache-remote-ip
cache the remote IP property
This commit is contained in:
commit
55b39a3f15
|
@ -142,7 +142,9 @@ class Request(dict):
|
|||
|
||||
@property
|
||||
def ip(self):
|
||||
return self.transport.get_extra_info('peername')
|
||||
if not hasattr(self, '_ip'):
|
||||
self._ip = self.transport.get_extra_info('peername')
|
||||
return self._ip
|
||||
|
||||
|
||||
File = namedtuple('File', ['type', 'body', 'name'])
|
||||
|
|
Loading…
Reference in New Issue
Block a user