#![cfg(all(not(target_arch = "wasm32"), feature = "curl-backend"))]
mod common;
use common::httpbin_uri;
use zenwave::{Client, Proxy, Transport, backend::CurlBackend};
#[test_executors::async_test]
async fn libcurl_does_not_read_the_environment_on_its_own() {
unsafe {
std::env::set_var("http_proxy", "http://127.0.0.1:1");
std::env::set_var("HTTP_PROXY", "http://127.0.0.1:1");
std::env::set_var("all_proxy", "http://127.0.0.1:1");
}
let transport = Transport::builder()
.proxy(Proxy::none())
.build()
.expect("transport builds");
let mut client = CurlBackend::new(transport);
client
.get(httpbin_uri("/get"))
.expect("valid request")
.await
.expect("Proxy::none() means a direct connection whatever the environment says");
}