chg: [domain lookup] extract domain from url input

This commit is contained in:
terrtia 2024-10-04 13:44:50 +02:00
parent 5a052c47d9
commit d91e14f200
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -69,6 +69,8 @@ faup = Faup()
def api_get_onion_lookup(domain): def api_get_onion_lookup(domain):
domain = domain.lower() domain = domain.lower()
url_unpack = unpack_url(domain)
domain = url_unpack['domain']
dom = Domain(domain) dom = Domain(domain)
if not is_valid_onion_v3_domain(domain): if not is_valid_onion_v3_domain(domain):
return {'error': 'Invalid Domain', 'domain': domain}, 404 return {'error': 'Invalid Domain', 'domain': domain}, 404