Skip to content

Commit

Permalink
Fix port showing up as None bug (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
dongreenberg authored Feb 15, 2024
1 parent 1ba4499 commit 9ad897c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runhouse/servers/http/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class HTTPClient:
def __init__(
self,
host: str,
port: int,
port: Optional[int],
auth=None,
cert_path=None,
use_https=False,
Expand Down Expand Up @@ -142,7 +142,9 @@ def from_endpoint(endpoint: str, auth=None, cert_path=None):

def _formatted_url(self, endpoint: str):
prefix = "https" if self.use_https else "http"
return f"{prefix}://{self.host}:{self.port}/{endpoint}"
if self.port:
return f"{prefix}://{self.host}:{self.port}/{endpoint}"
return f"{prefix}://{self.host}/{endpoint}"

def request(
self,
Expand Down

0 comments on commit 9ad897c

Please sign in to comment.