Revert "Added IPware algorithm"

This reverts commit bdf66cb

WTF HOW DO I GIT
This commit is contained in:
David Tan 2017-10-19 19:20:44 -04:00
parent ca10e67d64
commit f4f6cc15c2

View File

@ -169,14 +169,8 @@ class Request(dict):
@property
def ip(self):
if not hasattr(self, '_ip'):
self._ip = None
for key in HEADER_PRECEDENCE_ORDER:
value = self.headers.get(key, self.headers.get(key.replace('_', '-'), '')).strip()
if value is not None and value != '':
for ip_str in [ip.strip().lower() for ip in value.split(',')]:
if ip_str and is_valid_ip(ip_str):
if not ip_str.startswith(NON_PUBLIC_IP_PREFIX):
self._ip = ip_str
self._ip = (self.transport.get_extra_info('peername') or
(None, None))
return self._ip
@property