Snake case

main
Bob Mottram 2021-12-27 21:29:21 +00:00
parent 602ab1ad58
commit 0efd2c1b78
2 changed files with 4 additions and 4 deletions

View File

@ -260,7 +260,7 @@ from utils import get_image_extension_from_mime_type
from utils import get_image_mime_type from utils import get_image_mime_type
from utils import has_object_dict from utils import has_object_dict
from utils import user_agent_domain 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 permitted_dir
from utils import is_account_dir from utils import is_account_dir
from utils import get_occupation_skills from utils import get_occupation_skills
@ -1729,7 +1729,7 @@ class PubServer(BaseHTTPRequestHandler):
else: else:
ipAddress = self.client_address[0] ipAddress = self.client_address[0]
if not domain.endswith('.onion'): if not domain.endswith('.onion'):
if not isLocalNetworkAddress(ipAddress): if not is_local_network_address(ipAddress):
print('Login attempt from IP: ' + str(ipAddress)) print('Login attempt from IP: ' + str(ipAddress))
if not authorizeBasic(base_dir, '/users/' + if not authorizeBasic(base_dir, '/users/' +
loginNickname + '/outbox', loginNickname + '/outbox',
@ -1739,7 +1739,7 @@ class PubServer(BaseHTTPRequestHandler):
failTime = int(time.time()) failTime = int(time.time())
self.server.last_login_failure = failTime self.server.last_login_failure = failTime
if not domain.endswith('.onion'): if not domain.endswith('.onion'):
if not isLocalNetworkAddress(ipAddress): if not is_local_network_address(ipAddress):
recordLoginFailure(base_dir, ipAddress, recordLoginFailure(base_dir, ipAddress,
self.server.login_failure_count, self.server.login_failure_count,
failTime, failTime,

View File

@ -840,7 +840,7 @@ def get_local_network_addresses() -> []:
return ('localhost', '127.0.', '192.168', '10.0.') 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() localIPs = get_local_network_addresses()