diff --git a/src/saic_ismart_client_ng/api/base.py b/src/saic_ismart_client_ng/api/base.py index d14cf8f..f3745ea 100644 --- a/src/saic_ismart_client_ng/api/base.py +++ b/src/saic_ismart_client_ng/api/base.py @@ -211,7 +211,7 @@ async def __deserialize( raise SaicApiException(f"Failed to deserialize response: {e}. Original json was {response.text}") from e def logout(self): - self.__api_client.user_token = None + self.__api_client.user_token = '' self.__token_expiration = None @property diff --git a/src/saic_ismart_client_ng/net/client/__init__.py b/src/saic_ismart_client_ng/net/client/__init__.py index 22305e0..b3e92a5 100644 --- a/src/saic_ismart_client_ng/net/client/__init__.py +++ b/src/saic_ismart_client_ng/net/client/__init__.py @@ -19,8 +19,8 @@ def __init__( self.__configuration = configuration self.__listener = listener self.__logger = logger - self.__user_token = "" - self.__class_name = "" + self.__user_token: str = '' + self.__class_name: str = '' self.__client = httpx.AsyncClient( event_hooks={ "request": [self.__invoke_request_listener, self.__encrypt_request], diff --git a/src/saic_ismart_client_ng/net/crypto.py b/src/saic_ismart_client_ng/net/crypto.py index ab3ea53..54344d1 100644 --- a/src/saic_ismart_client_ng/net/crypto.py +++ b/src/saic_ismart_client_ng/net/crypto.py @@ -59,6 +59,10 @@ def encrypt_request( user_token: str = "", class_name: str = "", ) -> (str, dict): + if user_token is None: + user_token = "" + if class_name is None: + class_name = "" original_content_type = original_request_headers.get("Content-Type") # 'application/x-www-form-urlencoded' if not original_content_type: modified_content_type = "application/json"