mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: Domain handle can be absent in RDAP response
This commit is contained in:
@@ -18,7 +18,6 @@ use Symfony\Component\Serializer\Attribute\Groups;
|
||||
use Symfony\Component\Serializer\Attribute\SerializedName;
|
||||
|
||||
#[ORM\Entity(repositoryClass: DomainRepository::class)]
|
||||
#[UniqueEntity('handle')]
|
||||
#[ApiResource(
|
||||
operations: [
|
||||
new GetCollection(
|
||||
@@ -53,7 +52,7 @@ class Domain
|
||||
#[Groups(['domain:item', 'domain:list', 'watchlist:item'])]
|
||||
private ?string $ldhName = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
#[Groups(['domain:item', 'domain:list', 'watchlist:item'])]
|
||||
private ?string $handle = null;
|
||||
|
||||
|
||||
@@ -91,9 +91,10 @@ readonly class RDAPService
|
||||
$domain
|
||||
->setTld($tld)
|
||||
->setLdhName($res['ldhName'])
|
||||
->setHandle($res['handle'])
|
||||
->setStatus($res['status']);
|
||||
|
||||
if (array_key_exists('handle', $res)) $domain->setHandle($res['handle']);
|
||||
|
||||
|
||||
foreach ($res['events'] as $rdapEvent) {
|
||||
$eventAction = EventAction::from($rdapEvent['eventAction']);
|
||||
|
||||
Reference in New Issue
Block a user