diff options
| author | Bob Halley <halley@dnspython.org> | 2020-06-16 14:01:12 -0700 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2020-06-16 14:01:12 -0700 |
| commit | bcdeb77f0503e90f5ce8c4b147188df4df191eac (patch) | |
| tree | bb5cade106cccbbca44c3b9f63beb289972d502b /dns/resolver.py | |
| parent | e3c7fa8b24b0f7c2d5889f49dc4b72b749d331d3 (diff) | |
| download | dnspython-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.py | 9 |
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 |
