mirror of
https://github.com/chatmail/relay.git
synced 2026-05-19 20:38:05 +00:00
fix(dns): address possible IndexError
This commit is contained in:
@@ -72,7 +72,7 @@ def get_authoritative_ns(domain):
|
|||||||
f"dig -r -q {domain} -t NS +noall +authority +answer", print=log_progress
|
f"dig -r -q {domain} -t NS +noall +authority +answer", print=log_progress
|
||||||
).split("\n")
|
).split("\n")
|
||||||
]
|
]
|
||||||
filtered_replies = [a for a in ns_replies if len(a) >= 3 and a[3] in ("SOA", "NS")]
|
filtered_replies = [a for a in ns_replies if len(a) >= 5 and a[3] in ("SOA", "NS")]
|
||||||
if not filtered_replies:
|
if not filtered_replies:
|
||||||
return
|
return
|
||||||
return filtered_replies[0][4]
|
return filtered_replies[0][4]
|
||||||
|
|||||||
Reference in New Issue
Block a user