Unverified Commit da75d3ab authored by André's avatar André

Only convert domain name to ASCII

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

Fixes #10010.
parent 25ddc9d2
Pipeline #7326 passed with stages
in 7 minutes and 24 seconds
......@@ -139,11 +139,11 @@ def puny_encode_url(url):
_url = '//' + _url
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