Skip to content

Commit

Permalink
fix: properly pass the auth parameter to the request
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Feb 28, 2019
1 parent 3e64a7b commit e688a3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pymisp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def _prepare_request(self, request_type, url, data=None,
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,
Expand All @@ -180,9 +181,9 @@ def _prepare_request(self, request_type, url, data=None,
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 ####
Expand Down

0 comments on commit e688a3e

Please sign in to comment.