mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-08 12:13:34 +02:00
Handle domains without TLD
This commit is contained in:
parent
3f7dbd5f6e
commit
919fbbfd2f
2 changed files with 44 additions and 0 deletions
|
@ -108,6 +108,10 @@ def rdap(request, domain=""):
|
|||
Domain = apps.get_model("registrar.Domain")
|
||||
domain = request.GET.get("domain", "")
|
||||
|
||||
# If inputted domain doesn't have a TLD, append .gov to it
|
||||
if "." not in domain:
|
||||
domain = f"{domain}.gov"
|
||||
|
||||
rdap_data = requests.get(RDAP_URL.format(domain=domain)).json()
|
||||
return JsonResponse(rdap_data)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue