fix: Trim address before parsing
All checks were successful
Build Docker / Build Image (push) Successful in 37s

This commit is contained in:
Nathan Woodburn 2025-02-01 17:20:10 +11:00
parent 47f210e51b
commit 80a4628d77
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
3 changed files with 3 additions and 2 deletions

View File

@ -388,7 +388,7 @@ def check_hip2(domain: str):
domain = domain.lower()
if re.match(r'^[a-zA-Z0-9\-\.]{1,63}$', domain) is None:
return 'Invalid address'
return 'Invalid domain'
address = domainLookup.hip2(domain)
if address.startswith("Hip2: "):

View File

@ -114,6 +114,7 @@ def hip2(domain: str):
# Catch all exceptions
except Exception as e:
print(f"Hip2: Lookup failed with error: {e}")
return "Hip2: Lookup failed."

View File

@ -208,7 +208,7 @@ def check_address():
if address is None:
return jsonify({"result": "Invalid address"})
return jsonify({"result": account_module.check_address(address)})
return jsonify({"result": account_module.check_address(address.strip())})
#endregion
#region Domains