Fix regex used in urisplit. It failed to split the host:port part.
This commit is contained in:
parent
c1cbc07645
commit
addaaa9242
|
@ -47,7 +47,7 @@ def urisplit(uri):
|
||||||
return 443 as default port if proto is https else 80
|
return 443 as default port if proto is https else 80
|
||||||
'''
|
'''
|
||||||
import re
|
import re
|
||||||
regex = '(([^:/]+)(://))?([^/]*)(:)*([^/]*)(/?.*)'
|
regex = '(([^:/]+)(://))?([^:/]*)(:)?([^/]*)(/?.*)'
|
||||||
grouped = re.match(regex, uri).groups()
|
grouped = re.match(regex, uri).groups()
|
||||||
proto, host, port, path = grouped[1], grouped[3], grouped[5], grouped[6]
|
proto, host, port, path = grouped[1], grouped[3], grouped[5], grouped[6]
|
||||||
if not port:
|
if not port:
|
||||||
|
|
Loading…
Reference in New Issue