diff --git a/fedn/network/clients/fedn_client.py b/fedn/network/clients/fedn_client.py index 298693503..81b95033a 100644 --- a/fedn/network/clients/fedn_client.py +++ b/fedn/network/clients/fedn_client.py @@ -9,6 +9,7 @@ from contextlib import contextmanager from io import BytesIO from typing import Any, Optional, Tuple, Union +from urllib.parse import urljoin import psutil import requests @@ -146,7 +147,7 @@ def set_backward_callback(self, callback: callable): def connect_to_api(self, url: str, token: str, json: dict) -> Tuple[ConnectToApiResult, Any]: """Connect to the FEDn API.""" - url_endpoint = f"{url}api/v1/clients/add" + url_endpoint = urljoin(url, "api/v1/clients/add") logger.info(f"Connecting to API endpoint: {url_endpoint}") try: