DreamStream-1 commited on
Commit
8ac75ee
·
verified ·
1 Parent(s): d64fbd2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2781,7 +2781,7 @@ async def send_product_image_with_caption(from_number: str, product: Dict[str, A
2781
  'Connection': 'keep-alive',
2782
  'Upgrade-Insecure-Requests': '1'
2783
  }
2784
- test_response = requests.head(image_url, headers=headers, timeout=10, allow_redirects=True)
2785
  if test_response.status_code != 200:
2786
  logger.warning(f"[Product] Image URL not accessible (status {test_response.status_code}): {image_url}")
2787
  raise Exception(f"Image URL not accessible: {test_response.status_code}")
@@ -3511,7 +3511,7 @@ async def send_product_image_with_caption(from_number: str, product: Dict[str, A
3511
  'Connection': 'keep-alive',
3512
  'Upgrade-Insecure-Requests': '1'
3513
  }
3514
- test_response = requests.head(image_url, headers=headers, timeout=10, allow_redirects=True)
3515
  if test_response.status_code != 200:
3516
  logger.warning(f"[Product] Image URL not accessible (status {test_response.status_code}): {image_url}")
3517
  raise Exception(f"Image URL not accessible: {test_response.status_code}")
 
2781
  'Connection': 'keep-alive',
2782
  'Upgrade-Insecure-Requests': '1'
2783
  }
2784
+ test_response = requests.get(image_url, headers=headers, timeout=10, stream=True, allow_redirects=True)
2785
  if test_response.status_code != 200:
2786
  logger.warning(f"[Product] Image URL not accessible (status {test_response.status_code}): {image_url}")
2787
  raise Exception(f"Image URL not accessible: {test_response.status_code}")
 
3511
  'Connection': 'keep-alive',
3512
  'Upgrade-Insecure-Requests': '1'
3513
  }
3514
+ test_response = requests.get(image_url, headers=headers, timeout=10, stream=True, allow_redirects=True)
3515
  if test_response.status_code != 200:
3516
  logger.warning(f"[Product] Image URL not accessible (status {test_response.status_code}): {image_url}")
3517
  raise Exception(f"Image URL not accessible: {test_response.status_code}")