forked from p15670423/monkey
keep path after removing port from URL
This commit is contained in:
parent
0d71e22b08
commit
eb4f50a0ca
|
@ -16,5 +16,5 @@ def get_host_from_network_location(network_location: str) -> str:
|
|||
def remove_port(url):
|
||||
parsed = urlparse(url)
|
||||
with_port = f'{parsed.scheme}://{parsed.netloc}'
|
||||
without_port = re.sub(':[0-9]+$', '', with_port)
|
||||
without_port = re.sub(':[0-9]+(?=$|\/)', '', with_port)
|
||||
return without_port
|
||||
|
|
Loading…
Reference in New Issue