use CONDUIT_VERSION_EXTRA in endpoints

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-03-29 18:21:33 -04:00 committed by June
parent 87a7c8d9e8
commit 47889410eb
3 changed files with 24 additions and 4 deletions

View file

@ -83,13 +83,18 @@ impl Client {
}
fn base(config: &Config) -> Result<reqwest::ClientBuilder> {
let version = match option_env!("CONDUIT_VERSION_EXTRA") {
Some(extra) => format!("{} ({})", env!("CARGO_PKG_VERSION"), extra),
None => env!("CARGO_PKG_VERSION").to_owned(),
};
let builder = reqwest::Client::builder()
.hickory_dns(true)
.timeout(Duration::from_secs(config.request_timeout))
.connect_timeout(Duration::from_secs(config.request_conn_timeout))
.pool_max_idle_per_host(config.request_idle_per_host.into())
.pool_idle_timeout(Duration::from_secs(config.request_idle_timeout))
.user_agent("Conduwuit".to_owned() + "/" + env!("CARGO_PKG_VERSION"))
.user_agent("Conduwuit".to_owned() + "/" + &version)
.redirect(redirect::Policy::limited(6));
if let Some(proxy) = config.proxy.to_proxy()? {