Skip to content

Commit 7d78630

Browse files
committed
Move cookie handling
1 parent 470c012 commit 7d78630

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

airos/base.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ def __init__(
6868

6969
self.base_url = f"{scheme}://{hostname}"
7070

71-
self.session = session
71+
# self.session = session
72+
self.session = aiohttp.ClientSession(
73+
connector=aiohttp.TCPConnector(verify_ssl=False, force_close=True),
74+
cookie_jar=aiohttp.CookieJar(),
75+
)
7276

7377
self.api_version: int = 8
7478

@@ -209,6 +213,7 @@ def _get_authenticated_headers(
209213
_LOGGER.error("TESTv%s - CSRF ID found %s", self.api_version, self._csrf_id)
210214
headers["X-CSRF-ID"] = self._csrf_id
211215

216+
"""
212217
if self._auth_cookie: # pragma: no cover
213218
_LOGGER.error(
214219
"TESTv%s - auth_cookie found: AIROS_%s",
@@ -217,6 +222,7 @@ def _get_authenticated_headers(
217222
)
218223
# headers["Cookie"] = f"AIROS_{self._auth_cookie}"
219224
headers["Cookie"] = self._auth_cookie
225+
"""
220226

221227
return headers
222228

0 commit comments

Comments
 (0)