diff --git a/sport_activities_features/missing_elevation_identification.py b/sport_activities_features/missing_elevation_identification.py index 748a28b..bb8910c 100644 --- a/sport_activities_features/missing_elevation_identification.py +++ b/sport_activities_features/missing_elevation_identification.py @@ -93,8 +93,11 @@ def fetch_elevation_data(self, payload_formatting: bool = True) -> list: path = url_parts.path # Establish connection - connection = http.client.HTTPSConnection(host) - + if self.open_elevation_api.startswith("http://"): + connection = http.client.HTTPConnection(host) + else: + connection = http.client.HTTPSConnection(host) + # Make the POST request connection.request("POST", path, body=json_payload, headers=headers)