Skip to content

Commit

Permalink
fix(bundler): Read http_proxy env when downloading resources.
Browse files Browse the repository at this point in the history
Signed-off-by: CaiJingLong <[email protected]>
  • Loading branch information
CaiJingLong committed Oct 13, 2023
1 parent 46dcb94 commit 240b8b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/add-proxy-for-nsis-download.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-bundler": 'patch:fix'
---

Add proxy for NSIS when downloading resources.
6 changes: 5 additions & 1 deletion tooling/bundler/src/bundle/windows/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ 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)
Expand Down

0 comments on commit 240b8b6

Please sign in to comment.