diff --git a/hole/v6.py b/hole/v6.py index eacc4a1..3f91549 100644 --- a/hole/v6.py +++ b/hole/v6.py @@ -191,9 +191,10 @@ async def _fetch_data(self, endpoint: str, params=None) -> dict: if response.status == 401: _LOGGER.info("Session expired, re-authenticating") await self.authenticate() - headers["X-FTL-SID"] = self._session_id - if self._csrf_token: - headers["X-FTL-CSRF"] = self._csrf_token + if self._session_id: + headers["X-FTL-SID"] = self._session_id + if self._csrf_token: + headers["X-FTL-CSRF"] = self._csrf_token response = await self._session.get( url, params=params, headers=headers, ssl=self.verify_tls )