From eb4f50a0ca309e589a2270396a4e67218e47872f Mon Sep 17 00:00:00 2001 From: ophirharpazg Date: Wed, 2 Sep 2020 00:17:02 +0300 Subject: [PATCH] keep path after removing port from URL --- monkey/common/network/network_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/common/network/network_utils.py b/monkey/common/network/network_utils.py index 859bafb1f..e99d0cf2b 100644 --- a/monkey/common/network/network_utils.py +++ b/monkey/common/network/network_utils.py @@ -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