mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Don't rely on netloc for determining hostname and port, just use hostname and port (#56270)
* Add changelog fragment * Fix IPv6 address parsing for py2.6, and add tests * make sure hostname isn't None
This commit is contained in:
@@ -76,6 +76,16 @@ def test_maybe_add_ssl_handler(mocker):
|
||||
handler = urls.maybe_add_ssl_handler(url, True)
|
||||
assert handler is None
|
||||
|
||||
url = 'https://[2a00:16d8:0:7::205]:4443/'
|
||||
handler = urls.maybe_add_ssl_handler(url, True)
|
||||
assert handler.hostname == '2a00:16d8:0:7::205'
|
||||
assert handler.port == 4443
|
||||
|
||||
url = 'https://[2a00:16d8:0:7::205]/'
|
||||
handler = urls.maybe_add_ssl_handler(url, True)
|
||||
assert handler.hostname == '2a00:16d8:0:7::205'
|
||||
assert handler.port == 443
|
||||
|
||||
|
||||
def test_basic_auth_header():
|
||||
header = urls.basic_auth_header('user', 'passwd')
|
||||
|
||||
Reference in New Issue
Block a user