Skip to content

Commit 464c110

Browse files
authored
feat: only encode url once (#7)
1 parent 9c099ca commit 464c110

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

aiosteamist/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import aiohttp
88
import xmltodict # type: ignore
9+
from yarl import URL
910

1011
__author__ = """J. Nick Koston"""
1112
__email__ = "nick@koston.org"
@@ -49,12 +50,13 @@ def __init__(
4950
self._timeout = timeout
5051
self._host = host
5152
self._auth_invalid = 0
53+
self._url = URL(f"http://{self._host}")
5254

5355
async def _get(self, endpoint: str, params=None) -> str:
5456
"""Make a get request."""
5557
response = await self._websession.request(
5658
"GET",
57-
f"http://{self._host}{endpoint}",
59+
self._url.join(URL(endpoint)),
5860
timeout=self._timeout,
5961
params=params,
6062
)

0 commit comments

Comments
 (0)