Don't send private ip addresses on pex
This commit is contained in:
parent
a6f86329c5
commit
c2edbb30b5
5 changed files with 28 additions and 5 deletions
|
@ -216,4 +216,8 @@ def avg(items):
|
|||
if len(items) > 0:
|
||||
return sum(items) / len(items)
|
||||
else:
|
||||
return 0
|
||||
return 0
|
||||
|
||||
local_ip_pattern = re.compile(r"^(127\.)|(192\.168\.)|(10\.)|(172\.1[6-9]\.)|(172\.2[0-9]\.)|(172\.3[0-1]\.)|(::1$)|([fF][cCdD])")
|
||||
def isPrivateIp(ip):
|
||||
return local_ip_pattern.match(ip)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue