Skip to content

Commit

Permalink
fix(bundler): read proxy when downloading resources. (#8012)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
CaiJingLong authored Oct 13, 2023
1 parent 441eb4f commit d0ae675
Show file tree
Hide file tree
Showing 2 changed files with 8 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: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();

Check failure on line 26 in tooling/bundler/src/bundle/windows/util.rs

View workflow job for this annotation

GitHub Actions / run-integration-tests (macos-latest)

no method named `try_proxy_from_env` found for struct `AgentBuilder` in the current scope

Check failure on line 26 in tooling/bundler/src/bundle/windows/util.rs

View workflow job for this annotation

GitHub Actions / run-integration-tests (ubuntu-latest)

no method named `try_proxy_from_env` found for struct `AgentBuilder` in the current scope

Check failure on line 26 in tooling/bundler/src/bundle/windows/util.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

no method named `try_proxy_from_env` found for struct `AgentBuilder` in the current scope

Check failure on line 26 in tooling/bundler/src/bundle/windows/util.rs

View workflow job for this annotation

GitHub Actions / run-integration-tests (windows-latest)

no method named `try_proxy_from_env` found for struct `AgentBuilder` in the current scope

Check failure on line 26 in tooling/bundler/src/bundle/windows/util.rs

View workflow job for this annotation

GitHub Actions / test (macos-latest)

no method named `try_proxy_from_env` found for struct `AgentBuilder` in the current scope

Check failure on line 26 in tooling/bundler/src/bundle/windows/util.rs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

no method named `try_proxy_from_env` found for struct `AgentBuilder` in the current scope
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 d0ae675

Please sign in to comment.