Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:bug'
---

Read `HTTP_PROXY` env var when downloading bundling resources on Windows.
4 changes: 3 additions & 1 deletion tooling/bundler/src/bundle/windows/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading