Skip to content

Commit

Permalink
mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
silamon committed Dec 9, 2024
1 parent b9748bb commit e2c95ea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/linkplay/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ def __init__(
"http",
"https",
], "Protocol must be either 'http' or 'https'"
if (protocol == "http" and port != 80) or (protocol == "https" and port != 443):
self._endpoint: str = f"{protocol}://{endpoint}:{port}"
else:
self._endpoint: str = f"{protocol}://{endpoint}"
include_port = (protocol == "http" and port != 80) or (
protocol == "https" and port != 443
)
port_suffix = f":{port}" if include_port else ""
self._endpoint: str = f"{protocol}://{endpoint}{port_suffix}"

self._session: ClientSession = session

Expand Down

0 comments on commit e2c95ea

Please sign in to comment.