diff --git a/daemon.py b/daemon.py index 0984f7498..17dd68ea2 100644 --- a/daemon.py +++ b/daemon.py @@ -260,7 +260,7 @@ from utils import get_image_extension_from_mime_type from utils import get_image_mime_type from utils import has_object_dict from utils import user_agent_domain -from utils import isLocalNetworkAddress +from utils import is_local_network_address from utils import permitted_dir from utils import is_account_dir from utils import get_occupation_skills @@ -1729,7 +1729,7 @@ class PubServer(BaseHTTPRequestHandler): else: ipAddress = self.client_address[0] if not domain.endswith('.onion'): - if not isLocalNetworkAddress(ipAddress): + if not is_local_network_address(ipAddress): print('Login attempt from IP: ' + str(ipAddress)) if not authorizeBasic(base_dir, '/users/' + loginNickname + '/outbox', @@ -1739,7 +1739,7 @@ class PubServer(BaseHTTPRequestHandler): failTime = int(time.time()) self.server.last_login_failure = failTime if not domain.endswith('.onion'): - if not isLocalNetworkAddress(ipAddress): + if not is_local_network_address(ipAddress): recordLoginFailure(base_dir, ipAddress, self.server.login_failure_count, failTime, diff --git a/utils.py b/utils.py index 93fead4cc..291696e38 100644 --- a/utils.py +++ b/utils.py @@ -840,7 +840,7 @@ def get_local_network_addresses() -> []: return ('localhost', '127.0.', '192.168', '10.0.') -def isLocalNetworkAddress(ipAddress: str) -> bool: +def is_local_network_address(ipAddress: str) -> bool: """ """ localIPs = get_local_network_addresses()