mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
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:
5
.changes/add-proxy-for-nsis-download.md
Normal file
5
.changes/add-proxy-for-nsis-download.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-bundler": 'patch:bug'
|
||||
---
|
||||
|
||||
Read `HTTP_PROXY` env var when downloading bundling resources on Windows.
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user