From b6c32eb17bfcd8dc511a8880d1efb752a6fd8640 Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Tue, 26 Sep 2023 21:00:29 +0300 Subject: [PATCH] fixed possible bug in the `get_stream` Signed-off-by: Alexander Piskun --- nc_py_api/_session.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nc_py_api/_session.py b/nc_py_api/_session.py index 917c1218..642aa4ee 100644 --- a/nc_py_api/_session.py +++ b/nc_py_api/_session.py @@ -152,8 +152,9 @@ def __del__(self): self.adapter.close() def get_stream(self, path: str, params: Optional[dict] = None, **kwargs) -> Iterator[Response]: + headers = kwargs.pop("headers", {}) return self._get_stream( - f"{quote(path)}?{urlencode(params, True)}" if params else quote(path), kwargs.get("headers", {}), **kwargs + f"{quote(path)}?{urlencode(params, True)}" if params else quote(path), headers=headers, **kwargs ) def _get_stream(self, path_params: str, headers: dict, **kwargs) -> Iterator[Response]: