Skip to content

Commit 8e634ae

Browse files
committed
fix: do not create redundant session in session token manager
1 parent 34565fd commit 8e634ae

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎ibmcloudant/couchdb_session_token_manager.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, username: str, password: str,
5454

5555
self.token = None
5656

57-
self.http_client = Session()
57+
self.http_client = None
5858
self.http_config = {}
5959
self.jar = None
6060
self.headers = None
@@ -67,6 +67,9 @@ def request_token(self):
6767
A CookieJar of Cookies the server sent back.
6868
"""
6969

70+
if not isinstance(self.http_client, Session):
71+
raise TypeError("http_client parameter must be a requests.sessions.Session")
72+
7073
response = self.http_client.request(
7174
method='POST',
7275
url=self.url + "/_session",

0 commit comments

Comments
 (0)