Skip to content

Commit

Permalink
set media_type to image/webp for get_child_image FileResponse
Browse files Browse the repository at this point in the history
- automatically inferred type caused `Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.` runtime error in frontend
  • Loading branch information
lkeegan committed Nov 20, 2024
1 parent a09ab61 commit 8e56030
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mondey_backend/src/mondey_backend/routers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 8e56030

Please sign in to comment.