From: Bob Halley Date: Tue, 16 Jun 2020 21:01:12 +0000 (-0700) Subject: Take nameservers that are not IPv4/v6 addresses or https URLs out of the X-Git-Tag: v2.0.0rc1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcdeb77f0503e90f5ce8c4b147188df4df191eac;p=thirdparty%2Fdnspython.git Take nameservers that are not IPv4/v6 addresses or https URLs out of the mix. This also fixes the UnboundLocalError from [Issue #509]. --- diff --git a/dns/resolver.py b/dns/resolver.py index 4948d969..1fe92249 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -1083,11 +1083,10 @@ class Resolver: raise_on_truncation=True) else: protocol = urlparse(nameserver).scheme - if protocol == 'https': - response = dns.query.https(request, nameserver, - timeout=timeout) - elif protocol: - continue + if protocol != 'https': + raise NotImplementedError + response = dns.query.https(request, nameserver, + timeout=timeout) except Exception as ex: (_, done) = resolution.query_result(None, ex) continue