Merge pull request #37 from pritambaral/urlparse

More accurate host, port parsing
This commit is contained in:
Aldo Cortesi 2014-09-07 12:46:01 +12:00
commit 52f430c934

View File

@ -45,6 +45,8 @@ def parse_url(url):
return None return None
if not scheme: if not scheme:
return None return None
if '@' in netloc:
_, netloc = string.rsplit(netloc, '@', maxsplit=1)
if ':' in netloc: if ':' in netloc:
host, port = string.rsplit(netloc, ':', maxsplit=1) host, port = string.rsplit(netloc, ':', maxsplit=1)
try: try: