From f4f6cc15c283ddb1ce12f94b4f69bc5ef0df2afd Mon Sep 17 00:00:00 2001 From: David Tan Date: Thu, 19 Oct 2017 19:20:44 -0400 Subject: [PATCH] Revert "Added IPware algorithm" This reverts commit bdf66cb WTF HOW DO I GIT --- sanic/request.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sanic/request.py b/sanic/request.py index ab70e49b..bc1be96b 100644 --- a/sanic/request.py +++ b/sanic/request.py @@ -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