File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ home = "0.5.3" # use same ver in build-dep
18
18
env_logger = " 0.8"
19
19
20
20
[build-dependencies ]
21
- ureq = " 1.0 " # allows to keep MSRV 1.41.1
21
+ ureq = " 2.1 "
22
22
bitcoin_hashes = " 0.10"
23
23
flate2 = " 1.0"
24
24
tar = " 0.4"
Original file line number Diff line number Diff line change @@ -73,8 +73,18 @@ fn main() {
73
73
) ;
74
74
let mut downloaded_bytes = Vec :: new ( ) ;
75
75
76
- let _size = ureq:: get ( & url)
76
+ let http_proxy = std:: env:: var ( "HTTPS_PROXY" ) . or_else ( |_| std:: env:: var ( "HTTP_PROXY" ) ) ;
77
+ let agent = if let Ok ( proxy) = http_proxy {
78
+ let proxy = ureq:: Proxy :: new ( proxy) . unwrap ( ) ;
79
+ ureq:: AgentBuilder :: new ( ) . proxy ( proxy) . build ( )
80
+ } else {
81
+ ureq:: AgentBuilder :: new ( ) . build ( )
82
+ } ;
83
+
84
+ let _size = agent
85
+ . get ( & url)
77
86
. call ( )
87
+ . unwrap ( )
78
88
. into_reader ( )
79
89
. read_to_end ( & mut downloaded_bytes)
80
90
. unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments