Commit 3ee7a5ac authored by Paul van der Linden's avatar Paul van der Linden
Browse files

fix: new session after closing should honour original headers and params

parent 2e5e6e29
......@@ -200,13 +200,17 @@ class Stream(object):
self.verify = options.get("verify", True)
self.api = API()
self.session = requests.Session()
self.session.headers = options.get("headers") or {}
self.session.params = None
self.headers = options.get("headers") or {}
self.new_session()
self.body = None
self.retry_time = self.retry_time_start
self.snooze_time = self.snooze_time_step
def new_session(self):
self.session = requests.Session()
self.session.headers = self.headers
self.session.params = None
def _run(self):
# Authenticate
url = "https://%s%s" % (self.host, self.url)
......@@ -270,7 +274,7 @@ class Stream(object):
if resp:
resp.close()
self.session = requests.Session()
self.new_session()
if exception:
# call a handler first so that the exception can be logged.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment