Skip to content

Commit a942f9a

Browse files
authored
404 as no-data instead of error
fix: treat RIPE Stat PDNS HTTP 404 as no-data instead of error
2 parents 7833a1b + 316f62b commit a942f9a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

rir_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,6 +2826,9 @@ async def passive_dns(inp: PassiveDNSInput) -> PassiveDNSResult:
28262826
params=params,
28272827
headers={"User-Agent": _USER_AGENT},
28282828
)
2829+
if r.status_code == 404:
2830+
# RIPE PDNS returns 404 when no records exist for a resource
2831+
return PassiveDNSResult(resource=inp.resource, total=0, records=[])
28292832
if r.status_code != 200:
28302833
return PassiveDNSResult(
28312834
resource=inp.resource,

0 commit comments

Comments
 (0)