Skip to content

Commit

Permalink
Do not add the port if it is NoneType. (#112)
Browse files Browse the repository at this point in the history
No-Issue

Signed-off-by: James Tanner <tanner.jc@gmail.com>
  • Loading branch information
jctanner authored May 29, 2024
1 parent b80be6b commit 370f2ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion galaxykit/gw_auth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ def __init__(self, auth, galaxy_root):
self.headers = {}
parsed_url = urlparse(self.galaxy_root)
self.url = f"{parsed_url.scheme}://{parsed_url.hostname}"
if (parsed_url.scheme == "https" and parsed_url.port != 443) or (parsed_url.scheme == "http" and parsed_url.port != 80):
if parsed_url.port is not None and (
(parsed_url.scheme == "https" and parsed_url.port != 443)
or (parsed_url.scheme == "http" and parsed_url.port != 80)
):
self.url += ":" + str(parsed_url.port)
self.host = parsed_url.hostname
self.login_url = f"{self.url}/api/gateway/v1/login/"
Expand Down

0 comments on commit 370f2ce

Please sign in to comment.