fix: Trim address before parsing
All checks were successful
Build Docker / Build Image (push) Successful in 37s
All checks were successful
Build Docker / Build Image (push) Successful in 37s
This commit is contained in:
parent
47f210e51b
commit
80a4628d77
@ -388,7 +388,7 @@ def check_hip2(domain: str):
|
|||||||
domain = domain.lower()
|
domain = domain.lower()
|
||||||
|
|
||||||
if re.match(r'^[a-zA-Z0-9\-\.]{1,63}$', domain) is None:
|
if re.match(r'^[a-zA-Z0-9\-\.]{1,63}$', domain) is None:
|
||||||
return 'Invalid address'
|
return 'Invalid domain'
|
||||||
|
|
||||||
address = domainLookup.hip2(domain)
|
address = domainLookup.hip2(domain)
|
||||||
if address.startswith("Hip2: "):
|
if address.startswith("Hip2: "):
|
||||||
|
@ -114,6 +114,7 @@ def hip2(domain: str):
|
|||||||
|
|
||||||
# Catch all exceptions
|
# Catch all exceptions
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print(f"Hip2: Lookup failed with error: {e}")
|
||||||
return "Hip2: Lookup failed."
|
return "Hip2: Lookup failed."
|
||||||
|
|
||||||
|
|
||||||
|
2
main.py
2
main.py
@ -208,7 +208,7 @@ def check_address():
|
|||||||
if address is None:
|
if address is None:
|
||||||
return jsonify({"result": "Invalid address"})
|
return jsonify({"result": "Invalid address"})
|
||||||
|
|
||||||
return jsonify({"result": account_module.check_address(address)})
|
return jsonify({"result": account_module.check_address(address.strip())})
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Domains
|
#region Domains
|
||||||
|
Loading…
Reference in New Issue
Block a user