From 6fc4456793d3d36efabc891dab1eb5d0bd80e8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Tue, 4 Mar 2025 19:51:46 +0100 Subject: [PATCH] fix: get TLD when ldhName is a TLD --- config/app/custom_rdap_servers.example.yaml | 2 +- src/Service/RDAPService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/app/custom_rdap_servers.example.yaml b/config/app/custom_rdap_servers.example.yaml index 4f9b11f..4d65c71 100644 --- a/config/app/custom_rdap_servers.example.yaml +++ b/config/app/custom_rdap_servers.example.yaml @@ -20,7 +20,7 @@ "publication": "1970-01-01T00:00:00Z", "services": [ - [ [ "" ], [ "https://rdap.iana.org/" ] ], # If you want to make RDAP queries to get TLD information from IANA + [ [ "." ], [ "https://rdap.iana.org/" ] ], # If you want to make RDAP queries to get TLD information from IANA [ [ "ad" ], [ "https://rdap.nic.ad/" ] ], [ [ "ae" ], [ "https://rdap.nic.ae/" ] ], [ [ "ki" ], [ "https://rdap.nic.ki/" ] ], diff --git a/src/Service/RDAPService.php b/src/Service/RDAPService.php index 6be7534..64c80d3 100644 --- a/src/Service/RDAPService.php +++ b/src/Service/RDAPService.php @@ -173,7 +173,7 @@ readonly class RDAPService private function getTld(string $domain): Tld { if (!str_contains($domain, '.')) { - $tldEntity = $this->tldRepository->findOneBy(['tld' => '']); + $tldEntity = $this->tldRepository->findOneBy(['tld' => '.']); if (null == $tldEntity) { throw new NotFoundHttpException("The requested TLD $domain is not yet supported, please try again with another one");