]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Take nameservers that are not IPv4/v6 addresses or https URLs out of the
authorBob Halley <halley@dnspython.org>
Tue, 16 Jun 2020 21:01:12 +0000 (14:01 -0700)
committerBob Halley <halley@dnspython.org>
Tue, 16 Jun 2020 21:01:12 +0000 (14:01 -0700)
mix.

This also fixes the UnboundLocalError from [Issue #509].

dns/resolver.py

index 4948d96955207b3681b8257f2d62534d6f3cd905..1fe922490113fd92cf2a9bf5862a9be28a261deb 100644 (file)
@@ -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