Skip to content

Commit

Permalink
fix cond
Browse files Browse the repository at this point in the history
  • Loading branch information
aliel committed Oct 12, 2023
1 parent 12b2ca1 commit 863e1e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/aleph/sdk/domain.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from enum import Enum
from ipaddress import IPv4Address, IPv6Address
from typing import Dict, Iterable, List, NewType, Optional, Union
from typing import Any, AsyncIterable, Dict, Iterable, List, NewType, Optional, Union
from urllib.parse import urlparse

import aiodns
Expand Down Expand Up @@ -47,11 +47,11 @@ async def get_ns_servers(self, hostname: Hostname):
fqdn = hostname

stop = False
while stop == False:
while stop is False:
"""**Detect and get authoritative NS server of subdomains if delegated**"""
try:
entries = await self.resolver.query(fqdn, "NS")
servers = []
servers: List[Any] = []
for entry in entries:
servers += await self.get_ipv6_addresses(entry.host)
servers += await self.get_ipv4_addresses(entry.host)
Expand All @@ -61,7 +61,7 @@ async def get_ns_servers(self, hostname: Hostname):
except aiodns.error.DNSError:
sub_domains = fqdn.split(".")
if len(sub_domains) > 2:
fqdn = ".".join(sub_domains[1:])
fqdn = Hostname(".".join(sub_domains[1:]))
continue

if len(sub_domains) == 2:
Expand Down Expand Up @@ -121,7 +121,7 @@ async def get_dnslink(self, hostname: Hostname) -> Optional[str]:

async def get_txt_values(
self, hostname: Hostname, delimiter: Optional[str] = None
) -> Iterable[str]:
) -> AsyncIterable[str]:
"""Returns all TXT values for a domain"""
entries: Iterable = await self.resolver.query(hostname, "TXT") or []
for entry in entries:
Expand Down

0 comments on commit 863e1e2

Please sign in to comment.