Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cosmpy/aerial/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ParsedUrl:
secure: bool
hostname: str
port: int
path: str

@property
def host_and_port(self) -> str:
Expand All @@ -71,6 +72,8 @@ def rest_url(self) -> str:
url = f"{prefix}://{self.hostname}"
if self.port != default_port:
url += f":{self.port}"
if self.path:
url += self.path
return url


Expand Down Expand Up @@ -103,5 +106,6 @@ def parse_url(url: str) -> ParsedUrl:

hostname = str(result.hostname)
port = default_port if result.port is None else int(result.port)
path = result.path if result.path else ""

return ParsedUrl(protocol=protocol, secure=secure, hostname=hostname, port=port)
return ParsedUrl(protocol=protocol, secure=secure, hostname=hostname, port=port, path=path)