mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-06-30 07:50:43 +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:
parent
66bfa27685
commit
493cf817a9
3 changed files with 33 additions and 13 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue