Skip to content

Commit 4444876

Browse files
committed
Fix image URL protocol handling in catalog image task
- Updated the find_product_image function to ensure that image URLs starting with "http://" are converted to "https://". This change enhances security by enforcing the use of secure connections for image retrieval.
1 parent 68a3d1f commit 4444876

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

app/tasks/catalog_image.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ def find_product_image(self, catalog_product_id: int):
298298
raise self.retry(exc=exc)
299299

300300
if image_url:
301+
if image_url.startswith("http://"):
302+
image_url = "https://" + image_url[7:]
301303
entry.image_url = image_url
302304
session.commit()
303305
logger.info("Set image_url for %s: %s", label, image_url)

0 commit comments

Comments
 (0)