Commit f96568ab by Michael DeHaan

Merge pull request #6521 from GDvalle/fix_ftp_urls

fetch_url: Avoid credential stripping for FTP-scheme URLs
parents 47f5bac6 77229553
...@@ -204,7 +204,7 @@ def fetch_url(module, url, data=None, headers=None, method=None, ...@@ -204,7 +204,7 @@ def fetch_url(module, url, data=None, headers=None, method=None,
ssl_handler = SSLValidationHandler(module, hostname, port) ssl_handler = SSLValidationHandler(module, hostname, port)
handlers.append(ssl_handler) handlers.append(ssl_handler)
if '@' in parsed[1]: if parsed[0] != 'ftp' and '@' in parsed[1]:
credentials, netloc = parsed[1].split('@', 1) credentials, netloc = parsed[1].split('@', 1)
if ':' in credentials: if ':' in credentials:
username, password = credentials.split(':', 1) username, password = credentials.split(':', 1)
......
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