mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-17 17:55:42 +00:00
Merge branch 'master' into feat/rss-feed
This commit is contained in:
commit
ef74ddf08a
@ -39,6 +39,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\RateLimiter\RateLimiterFactory;
|
||||
@ -408,7 +409,18 @@ class WatchListController extends AbstractController
|
||||
$domain = $this->domainRepository->findOneBy(['ldhName' => $ldhName]);
|
||||
|
||||
if (null === $domain) {
|
||||
$domain = $this->RDAPService->registerDomain($ldhName);
|
||||
try {
|
||||
$domain = $this->RDAPService->registerDomain($ldhName);
|
||||
} catch (NotFoundHttpException) {
|
||||
$domain = (new Domain())
|
||||
->setLdhName($ldhName)
|
||||
->setTld($this->RDAPService->getTld($ldhName))
|
||||
->setDelegationSigned(false)
|
||||
->setDeleted(true);
|
||||
|
||||
$this->em->persist($domain);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
if (false === $this->kernel->isDebug() && true === $this->getParameter('limited_features')) {
|
||||
$limiter = $this->rdapRequestsLimiter->create($this->getUser()->getUserIdentifier());
|
||||
|
||||
@ -170,7 +170,7 @@ readonly class RDAPService
|
||||
return $domain;
|
||||
}
|
||||
|
||||
private function getTld(string $domain): Tld
|
||||
public function getTld(string $domain): Tld
|
||||
{
|
||||
if (!str_contains($domain, '.')) {
|
||||
$tldEntity = $this->tldRepository->findOneBy(['tld' => '.']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user