From d693007726cda549a20dcc2843249fcb8434024a Mon Sep 17 00:00:00 2001 From: Chesars Date: Wed, 4 Mar 2026 23:36:44 -0300 Subject: [PATCH] fix(bfl): check HTTP status when downloading image from URL Add raise_for_status() to avoid sending error page content as image data to BFL API. --- litellm/llms/black_forest_labs/image_edit/transformation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/litellm/llms/black_forest_labs/image_edit/transformation.py b/litellm/llms/black_forest_labs/image_edit/transformation.py index 35b62a1e415..78898345bf6 100644 --- a/litellm/llms/black_forest_labs/image_edit/transformation.py +++ b/litellm/llms/black_forest_labs/image_edit/transformation.py @@ -200,6 +200,7 @@ class BlackForestLabsImageEditConfig(BaseImageEditConfig): if image.startswith(("http://", "https://")): # Download image from URL response = httpx.get(image, timeout=60.0) + response.raise_for_status() return response.content else: # Assume it's a file path