remove last dot (which is RFC possiblity) the dnspython way. thank Bob Halley
This commit is contained in:
parent
eae33b3677
commit
9e85df37b1
1 changed files with 101 additions and 102 deletions
|
@ -1584,10 +1584,9 @@ class Connection:
|
||||||
answers = [x for x in dns.resolver.query(query, 'SRV')]
|
answers = [x for x in dns.resolver.query(query, 'SRV')]
|
||||||
if answers:
|
if answers:
|
||||||
for a in answers:
|
for a in answers:
|
||||||
target = str(a.target)
|
target = dns.name.from_text(str(a.target))
|
||||||
if target.endswith('.'):
|
|
||||||
# target is f.e. talk.google.com. remove last dot
|
# target is f.e. talk.google.com. remove last dot
|
||||||
target = target[:-1]
|
target = target.to_text(omit_final_dot = True)
|
||||||
hosts.append({'host': target,
|
hosts.append({'host': target,
|
||||||
'port': int(a.port),
|
'port': int(a.port),
|
||||||
'prio': int(a.priority),
|
'prio': int(a.priority),
|
||||||
|
|
Loading…
Add table
Reference in a new issue