fix local node detection

This commit is contained in:
j 2016-02-14 11:24:17 +05:30
parent 9468d90714
commit 446d143d67

View file

@ -30,7 +30,7 @@ def is_local(host):
local_net = get_local_ipv4() local_net = get_local_ipv4()
if not local_net: if not local_net:
return False return False
local_net = local_net[:-2] local_net = '.'.join(local_net.split('.')[:-1]) + '.'
return host.startswith('127.0.0.1') or host.startswith(local_net) return host.startswith('127.0.0.1') or host.startswith(local_net)
def getaddrinfo(*args): def getaddrinfo(*args):