fix(bundler): read proxy when downloading resources. (#8012)

* fix(bundler): read http_proxy env when downloading resources.

Signed-off-by: CaiJingLong <cjl_spy@163.com>

* Update .changes/add-proxy-for-nsis-download.md

* Update add-proxy-for-nsis-download.md

* Update tooling/bundler/src/bundle/windows/util.rs

---------

Signed-off-by: CaiJingLong <cjl_spy@163.com>
This commit is contained in:
Caijinglong
2023-10-13 20:06:34 +08:00
committed by GitHub
parent 441eb4f4a5
commit d0ae67503c
2 changed files with 8 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"tauri-bundler": 'patch:bug'
---
Read `HTTP_PROXY` env var when downloading bundling resources on Windows.

View File

@@ -22,7 +22,9 @@ pub const WIX_UPDATER_OUTPUT_FOLDER_NAME: &str = "msi-updater";
pub fn download(url: &str) -> crate::Result<Vec<u8>> {
info!(action = "Downloading"; "{}", url);
let response = ureq::get(url).call().map_err(Box::new)?;
let agent = ureq::AgentBuilder::new().try_proxy_from_env(true).build();
let response = agent.get(url).call().map_err(Box::new)?;
let mut bytes = Vec::new();
response.into_reader().read_to_end(&mut bytes)?;
Ok(bytes)