diff --git a/src/cartsnitch_api/cache.py b/src/cartsnitch_api/cache.py index 02ff6d7..6766a8c 100644 --- a/src/cartsnitch_api/cache.py +++ b/src/cartsnitch_api/cache.py @@ -35,10 +35,12 @@ class CacheClient: async def get(self, key: str) -> str | None: if not self._client: return None - result = await self._client.get(key) - if result is None: + value = await self._client.get(key) + if value is None: return None - return str(result) + if isinstance(value, bytes): + return value.decode("utf-8", errors="replace") + return value async def set(self, key: str, value: str, ttl_seconds: int = 300) -> None: if not self._client: