Merge branch 'master' into feat/rss-feed

This commit is contained in:
Maël Gangloff 2025-05-19 11:26:10 +02:00
commit ef74ddf08a
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629
2 changed files with 14 additions and 2 deletions

View File

@ -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) {
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());

View File

@ -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' => '.']);