From 4a19b90794320a4204fc55e2cc91f9d827cd5e9f Mon Sep 17 00:00:00 2001 From: Matt Zizzi Date: Thu, 27 Jun 2019 09:11:55 -0400 Subject: [PATCH 1/2] bugfix persisten session headers --- pysnow/request.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pysnow/request.py b/pysnow/request.py index 7b38d4d..5ac6e30 100644 --- a/pysnow/request.py +++ b/pysnow/request.py @@ -112,10 +112,6 @@ def custom(self, method, path_append=None, headers=None, **kwargs): :return: - :class:`pysnow.Response` object """ - - if headers: - self._session.headers.update(headers) - if path_append is not None: try: self._url = self._url_builder.get_appended_custom(path_append) @@ -123,4 +119,4 @@ def custom(self, method, path_append=None, headers=None, **kwargs): raise InvalidUsage("Argument 'path_append' must be a string in the following format: " "/path-to-append[/.../...]") - return self._get_response(method, **kwargs) + return self._get_response(method, headers=headers, **kwargs) From 8674315bb7091c385db06f034ea8b12bce40eb22 Mon Sep 17 00:00:00 2001 From: Matt Zizzi Date: Thu, 27 Jun 2019 20:32:21 -0400 Subject: [PATCH 2/2] bugfix persistent session headers --- pysnow/request.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pysnow/request.py b/pysnow/request.py index 5ac6e30..06c0d0d 100644 --- a/pysnow/request.py +++ b/pysnow/request.py @@ -102,7 +102,7 @@ def delete(self, query): self._url = self._url_builder.get_appended_custom("/{0}".format(record['sys_id'])) return self._get_response('DELETE').one() - def custom(self, method, path_append=None, headers=None, **kwargs): + def custom(self, method, path_append=None, **kwargs): """Creates a custom request :param method: HTTP method @@ -119,4 +119,4 @@ def custom(self, method, path_append=None, headers=None, **kwargs): raise InvalidUsage("Argument 'path_append' must be a string in the following format: " "/path-to-append[/.../...]") - return self._get_response(method, headers=headers, **kwargs) + return self._get_response(method, **kwargs)