Skip to content

Commit

Permalink
Fix #128 - IP:port split once from the right
Browse files Browse the repository at this point in the history
  • Loading branch information
genotrance committed Feb 3, 2022
1 parent 5bacc57 commit 987606e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
TBD
- Fix #128 - IP:port split once from the right

v0.5.0 - 2022-01-26
- Added support for issue #58 - authentication with user/password when SSPI is
unavailable or not preferred.
Expand Down
6 changes: 3 additions & 3 deletions px.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ def get_destination(self):
# possibly involving connections
if State.noproxy.size:
addr = []
spl = netloc.split(":", 1)
spl = netloc.rsplit(":", 1)
try:
addr = socket.getaddrinfo(spl[0], int(spl[1]))
except socket.gaierror:
Expand All @@ -1101,7 +1101,7 @@ def get_destination(self):
proxy_str = find_proxy_for_url(
("https://" if "://" not in self.path else "") + self.path)
if proxy_str == "DIRECT":
ipport = netloc.split(":")
ipport = netloc.rsplit(":", 1)
ipport[1] = int(ipport[1])
dprint("Direct connection from PAC")
self.path = path
Expand Down Expand Up @@ -1469,7 +1469,7 @@ def parse_proxy(proxystrs):

servers = []
for proxystr in [i.strip() for i in proxystrs.split(",")]:
pserver = [i.strip() for i in proxystr.split(":")]
pserver = [i.strip() for i in proxystr.rsplit(":", 1)]
if len(pserver) == 1:
pserver.append(80)
elif len(pserver) == 2:
Expand Down
4 changes: 2 additions & 2 deletions tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def post(tagname):

id = create_release(tagname, "Px for Windows", get_history(), True)

add_asset_to_release("dist/px.exe", id)
#add_asset_to_release("dist/px.exe", id)

def main():
if "--wheel" in sys.argv:
Expand All @@ -202,7 +202,7 @@ def main():
os.system("python -m pip install keyring netaddr ntlm-auth psutil pywin32 winkerberos")

elif "--devel" in sys.argv:
os.system("python -m pip install --upgrade build twine")
os.system("python -m pip install --upgrade build twine wheel")

else:
print("""
Expand Down

0 comments on commit 987606e

Please sign in to comment.