Skip to content

Commit

Permalink
Better handling of session.
Browse files Browse the repository at this point in the history
If a session is our very own requester, we ensure that the
configuration is correclty loaded - first.
  • Loading branch information
funilrys committed Mar 17, 2024
1 parent 7c9c0b0 commit e7bcb1e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions PyFunceble/helpers/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ def __init__(
if session:
self._session = session
self._session_given = True

if hasattr(self._session, "guess_all_settings"):
# Ensure that PyFunceble's configuration is reloaded by the
# session object.
self._session.guess_all_settings()

if hasattr(self._session, "verify_certificate"):
self.certificate_validation = self._session.verify_certificate
else:
self._session, self._session_adapter = self.__get_session()

Expand Down

0 comments on commit e7bcb1e

Please sign in to comment.