Commit ea97a1dc authored by Alexandre's avatar Alexandre
Browse files

Disclaimer with urllib

parent 93ad596a
......@@ -863,7 +863,12 @@ else:
port = 443
if not is_valid_url(url):
error("DoH requires a valid HTTPS URL, not \"%s\"" % url)
url_parts = urllib.parse.urlparse(url)
try:
url_parts = urllib.parse.urlparse(url) # A very poor validation, many
# errors (for instance whitespaces, IPv6 address litterals without
# brackets...) are ignored.
except ValueError:
error(f'The provided url "{url}" could not be parsed')
netloc = url_parts.netloc
if forceIPv4:
family = socket.AF_INET
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment