fix(image): delegate DNS to explicit proxy

This commit is contained in:
chengyongru
2026-07-27 10:06:19 +08:00
committed by Xubin Ren
parent d73794bc68
commit b3d3a3e6c3
7 changed files with 83 additions and 15 deletions
+4 -1
View File
@@ -161,7 +161,10 @@ async def _download_image_data_url(
current_url = url
for _ in range(_IMAGE_DOWNLOAD_MAX_REDIRECTS + 1):
if proxy:
ok, error, _ = resolve_url_target(current_url)
ok, error, _ = resolve_url_target(
current_url,
trust_remote_dns=True,
)
if not ok:
raise ImageGenerationError(
f"blocked unsafe generated image URL: {error}"