Skip to content

Commit a3ccb58

Browse files
committed
download: Use an IP address when testing socks support
In order that we can test socks, we have to attempt an HTTP request in toto. Unfortunately if the test environment has broken (or intermittently failing) DNS then this test can fail incorrectly. By changing the request to an IP address we can check that the SOCKS proxy is used without needing to rely on the DNS. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
1 parent c1de43f commit a3ccb58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

download/tests/read-proxy-env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn socks_proxy_request() {
6464
});
6565

6666
let env_proxy = |url: &Url| for_url(&url).to_url();
67-
let url = Url::parse("http://example.org").unwrap();
67+
let url = Url::parse("http://192.168.0.1/").unwrap();
6868

6969
let client = Client::builder()
7070
.proxy(Proxy::custom(env_proxy))

0 commit comments

Comments
 (0)