From e01948a4c4abf299629393014f2e973477c5dc6c Mon Sep 17 00:00:00 2001 From: salty Date: Wed, 24 Apr 2024 16:40:22 +0200 Subject: [PATCH] use json.loads when updating cache --- app/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.py b/app/app.py index 4b90d13..66c6811 100644 --- a/app/app.py +++ b/app/app.py @@ -145,7 +145,7 @@ async def proxy(): if response.status_code == 304: logger.info(f"Using cached data for URL: {url_to_fetch}") - await set_to_cache(url_to_fetch, cached_resp["data"], cached_resp["etag"]) + await set_to_cache(url_to_fetch, json.loads(cached_resp["data"]), cached_resp["etag"]) return jsonify(json.loads(cached_resp["data"])) elif response.status_code == 200: await set_to_cache(url_to_fetch, response.json(), response.headers.get('ETag', ''))