fix: properly pass the auth parameter to the request

pull/362/head
Raphaël Vinot 2019-02-27 21:38:31 -08:00
parent 3e64a7b03d
commit e688a3e99f
1 changed files with 3 additions and 2 deletions

View File

@ -171,6 +171,7 @@ class PyMISP(object):
else:
local_session = requests.Session
with local_session() as s:
req.auth = self.auth
prepped = s.prepare_request(req)
prepped.headers.update(
{'Authorization': self.key,
@ -180,9 +181,9 @@ class PyMISP(object):
if logger.isEnabledFor(logging.DEBUG):
logger.debug(prepped.headers)
if self.asynch and background_callback is not None:
return s.send(prepped, verify=self.ssl, proxies=self.proxies, auth=self.auth, cert=self.cert, background_callback=background_callback)
return s.send(prepped, verify=self.ssl, proxies=self.proxies, cert=self.cert, background_callback=background_callback)
else:
return s.send(prepped, verify=self.ssl, proxies=self.proxies, auth=self.auth, cert=self.cert)
return s.send(prepped, verify=self.ssl, proxies=self.proxies, cert=self.cert)
# #####################
# ### Core helpers ####