From 7297eb40afb25f9b285c8c09f66d1b8e1d99fd55 Mon Sep 17 00:00:00 2001 From: dror-fs <122200684+dror-fs@users.noreply.github.com> Date: Fri, 10 Nov 2023 18:07:15 +0200 Subject: [PATCH] Fix ineffective mount operation HTTPAdatper mounted onto requests.Session using the 'http' prefix which is always superseded by already existing 'https://'. Effectively, the current code will not retry the mixpanel POST request and will cause a connection reset error. --- mixpanel/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mixpanel/__init__.py b/mixpanel/__init__.py index d93a1cb..5d3d5ee 100644 --- a/mixpanel/__init__.py +++ b/mixpanel/__init__.py @@ -572,7 +572,7 @@ def __init__(self, events_url=None, people_url=None, import_url=None, ) self._session = requests.Session() - self._session.mount('http', adapter) + self._session.mount('https://', adapter) def send(self, endpoint, json_message, api_key=None, api_secret=None): """Immediately record an event or a profile update.