diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fae1065..b0f94ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,7 +65,7 @@ jobs: strategy: fail-fast: false matrix: - toolchain: [ "1.41.1", "stable", "nightly" ] + toolchain: [ "1.42", "stable", "nightly" ] steps: - uses: actions/checkout@v2 diff --git a/Cargo.toml b/Cargo.toml index 051a8c6..1634046 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ home = "0.5.3" # use same ver in build-dep env_logger = "0.8" [build-dependencies] -ureq = "1.0" # allows to keep MSRV 1.41.1 +ureq = "2.1" bitcoin_hashes = "0.10" flate2 = "1.0" tar = "0.4" diff --git a/build.rs b/build.rs index cda27c1..d93ec4d 100644 --- a/build.rs +++ b/build.rs @@ -73,8 +73,18 @@ fn main() { ); let mut downloaded_bytes = Vec::new(); - let _size = ureq::get(&url) + let http_proxy = std::env::var("HTTPS_PROXY").or_else(|_| std::env::var("HTTP_PROXY")); + let agent = if let Ok(proxy) = http_proxy { + let proxy = ureq::Proxy::new(proxy).unwrap(); + ureq::AgentBuilder::new().proxy(proxy).build() + } else { + ureq::AgentBuilder::new().build() + }; + + let _size = agent + .get(&url) .call() + .unwrap() .into_reader() .read_to_end(&mut downloaded_bytes) .unwrap();