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.