Commit a72b39b1 authored by André's avatar André Committed by André

Only convert domain name to ASCII

IDNA is about domain name only, so ignore username, password and port.

Fixes #10010.
parent 48619565
Pipeline #7487 passed with stages
in 7 minutes and 19 seconds
......@@ -140,11 +140,11 @@ def puny_encode_url(url):
_url = '//' + _url
try:
o = urllib.parse.urlparse(_url)
p_loc = idn_to_ascii(o.netloc)
p_loc = idn_to_ascii(o.hostname)
except Exception:
log.debug('urlparse failed: %s', url)
return False
return url.replace(o.netloc, p_loc)
return url.replace(o.hostname, p_loc)
def parse_resource(resource):
"""
......
Markdown is supported
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