summaryrefslogtreecommitdiff
path: root/dns/resolver.py
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-06-16 14:01:12 -0700
committerBob Halley <halley@dnspython.org>2020-06-16 14:01:12 -0700
commitbcdeb77f0503e90f5ce8c4b147188df4df191eac (patch)
treebb5cade106cccbbca44c3b9f63beb289972d502b /dns/resolver.py
parente3c7fa8b24b0f7c2d5889f49dc4b72b749d331d3 (diff)
downloaddnspython-bcdeb77f0503e90f5ce8c4b147188df4df191eac.tar.gz
Take nameservers that are not IPv4/v6 addresses or https URLs out of the
mix. This also fixes the UnboundLocalError from [Issue #509].
Diffstat (limited to 'dns/resolver.py')
-rw-r--r--dns/resolver.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/dns/resolver.py b/dns/resolver.py
index 4948d96..1fe9224 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