diff --git a/preston/preston.py b/preston/preston.py index e4ba28d..c61ca66 100644 --- a/preston/preston.py +++ b/preston/preston.py @@ -66,6 +66,7 @@ def __init__(self, **kwargs: Any) -> None: self.access_token = kwargs.get("access_token") self.access_expiration = kwargs.get("access_expiration") self.refresh_token = kwargs.get("refresh_token") + self.stored_headers = [] self._kwargs = kwargs if not kwargs.get("no_update_token", False): self._try_refresh_access_token() @@ -253,7 +254,7 @@ def _get_path_for_op_id(self, id: str) -> Optional[str]: return path_key return None - def _insert_vars(self, path: str, data: dict) -> [str, dict]: + def _insert_vars(self, path: str, data: dict) -> tuple[str, dict]: """Inserts variables into the ESI URL path. Args: @@ -318,6 +319,7 @@ def get_path(self, path: str, data: dict) -> Tuple[dict, dict]: self._try_refresh_access_token() resp = self.session.get(target_url) self.cache.set(resp) + self.stored_headers.insert(0, resp.headers) if resp.text: return resp.json() return None diff --git a/pyproject.toml b/pyproject.toml index c892a54..2a55b15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "preston" -version = "4.5.0" +version = "4.6.0" description = "EVE ESI API access tool" authors = ["Celeo "] license = "MIT"