always use ipv4

This commit is contained in:
mat 2023-12-20 18:17:28 -06:00
parent 598b60b1f0
commit d496f3768d

View File

@ -1,6 +1,8 @@
use std::{ use std::{
collections::{BTreeSet, HashMap}, collections::{BTreeSet, HashMap},
net::IpAddr,
ops::Deref, ops::Deref,
str::FromStr,
sync::LazyLock, sync::LazyLock,
time::Instant, time::Instant,
}; };
@ -294,7 +296,12 @@ pub async fn autocomplete_with_engines(
Ok(merge_autocomplete_responses(autocomplete_results)) Ok(merge_autocomplete_responses(autocomplete_results))
} }
pub static CLIENT: LazyLock<reqwest::Client> = LazyLock::new(|| reqwest::Client::new()); pub static CLIENT: LazyLock<reqwest::Client> = LazyLock::new(|| {
reqwest::ClientBuilder::new()
.local_address(IpAddr::from_str("0.0.0.0").unwrap())
.build()
.unwrap()
});
pub async fn search( pub async fn search(
query: SearchQuery, query: SearchQuery,