[fix][run_batch]: respect proxy env vars when downloading media URLs (#47697)

Signed-off-by: mauyuyuace <qiming1.zhang@intel.com>

Qiming Zhang committed Jul 6, 2026 at 05:45 UTC 98e4726a147f37666e1e9adc468e673b32373e21
1 file changed +4 -12
vllm/entrypoints/openai/run_batch.py
+4 -12
@@ -28,6 +28,7 @@ from urllib3.util import parse_url
28
29 import vllm.envs as envs
30 from vllm.config import config
31 +from vllm.connections import global_http_connection
32 from vllm.engine.arg_utils import AsyncEngineArgs
33 from vllm.engine.protocol import EngineClient
34 from vllm.entrypoints.openai.api_server import init_app_state
@@ -493,18 +494,9 @@ async def download_bytes_from_url(
494 # between urllib3 and aiohttp (e.g. backslash-@ attacks).
495 url = url_spec.url
496
496 - async with (
497 - aiohttp.ClientSession() as session,
498 - session.get(
499 - url,
500 - allow_redirects=envs.VLLM_MEDIA_URL_ALLOW_REDIRECTS,
501 - ) as resp,
502 - ):
503 - if resp.status != 200:
504 - raise Exception(
505 - f"Failed to download data from URL: {url}. Status: {resp.status}"
506 - )
507 - return await resp.read()
497 + return await global_http_connection.async_get_bytes(
498 + url, allow_redirects=envs.VLLM_MEDIA_URL_ALLOW_REDIRECTS
499 + )
500
501 else:
502 raise ValueError(