ipaddress is not stdlib in Python 2

Let's copypaste from StackOverflow instead! https://www.xkcd.com/208/

Also, `localhost:///8096/emby/...` is not a valid HTTP(S) URL.
This commit is contained in:
Odd Stråbø 2019-10-05 04:44:24 +02:00
commit f565c0afbf
2 changed files with 10 additions and 7 deletions

View file

@ -476,6 +476,10 @@ class ConnectionManager(object):
return None
def _normalize_address(self, address):
# TODO: Try HTTPS first, then HTTP if that fails.
if '://' not in address:
address = 'http://' + address
# Attempt to correct bad input
url = urllib3.util.parse_url(address.strip())