Skip to content

Commit d0ae675

Browse files
authored
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>
1 parent 441eb4f commit d0ae675

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-bundler": 'patch:bug'
3+
---
4+
5+
Read `HTTP_PROXY` env var when downloading bundling resources on Windows.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ pub const WIX_UPDATER_OUTPUT_FOLDER_NAME: &str = "msi-updater";
2222

2323
pub fn download(url: &str) -> crate::Result<Vec<u8>> {
2424
info!(action = "Downloading"; "{}", url);
25-
let response = ureq::get(url).call().map_err(Box::new)?;
25+
26+
let agent = ureq::AgentBuilder::new().try_proxy_from_env(true).build();
27+
let response = agent.get(url).call().map_err(Box::new)?;
2628
let mut bytes = Vec::new();
2729
response.into_reader().read_to_end(&mut bytes)?;
2830
Ok(bytes)

0 commit comments

Comments
 (0)