From 8e560301a4d21127afabe7ad6549724c439743cc Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Wed, 20 Nov 2024 10:42:53 +0100 Subject: [PATCH] set `media_type` to `image/webp` for get_child_image FileResponse - automatically inferred type caused `Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.` runtime error in frontend --- mondey_backend/src/mondey_backend/routers/users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mondey_backend/src/mondey_backend/routers/users.py b/mondey_backend/src/mondey_backend/routers/users.py index ce317d0e..b5ff7e40 100644 --- a/mondey_backend/src/mondey_backend/routers/users.py +++ b/mondey_backend/src/mondey_backend/routers/users.py @@ -92,7 +92,7 @@ async def get_child_image( child = get_db_child(session, current_active_user, child_id) image_path = child_image_path(child_id) if child.has_image and image_path.exists(): - return image_path + return FileResponse(image_path, media_type="image/webp") raise HTTPException(404) @router.put("/children-images/{child_id}")