fix issues with using the http client using default-features=false (#6281)

This commit is contained in:
Jack Wampler
2025-12-10 11:54:24 -07:00
committed by GitHub
parent 59aeb63272
commit 9ecbdfc3af
2 changed files with 11 additions and 8 deletions
+10 -8
View File
@@ -895,20 +895,22 @@ impl Client {
self.retry_limit = limit;
}
#[cfg(feature = "tunneling")]
fn matches_current_host(&self, url: &Url) -> bool {
if cfg!(feature = "tunneling") {
if let Some(ref front) = self.front
&& front.is_enabled()
{
url.host_str() == self.current_url().front_str()
} else {
url.host_str() == self.current_url().host_str()
}
if let Some(ref front) = self.front
&& front.is_enabled()
{
url.host_str() == self.current_url().front_str()
} else {
url.host_str() == self.current_url().host_str()
}
}
#[cfg(not(feature = "tunneling"))]
fn matches_current_host(&self, url: &Url) -> bool {
url.host_str() == self.current_url().host_str()
}
/// If multiple base urls are available rotate to next (e.g. when the current one resulted in an error)
///
/// Takes an optional URL argument. If this is none, the current host will be updated automatically.
@@ -97,6 +97,7 @@ pub async fn attempt_retrieve_attestation(
let attestation = reqwest::ClientBuilder::new()
.user_agent(user_agent.unwrap_or_else(|| nym_http_api_client::generate_user_agent!()))
.timeout(std::time::Duration::from_secs(5))
.no_hickory_dns()
.build()
.map_err(retrieval_failure)?
.get(url)