dedupe version getting code, rename to CONDUWUIT_VERSION_EXTRA

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-05-01 13:35:16 -04:00 committed by June
parent 8ec9372a8e
commit a496cc4705
7 changed files with 26 additions and 41 deletions

View file

@ -2,7 +2,7 @@ use std::{sync::Arc, time::Duration};
use reqwest::redirect;
use crate::{service::globals::resolver, Config, Result};
use crate::{service::globals::resolver, utils::conduwuit_version, Config, Result};
pub(crate) struct Client {
pub(crate) default: reqwest::Client,
@ -87,10 +87,7 @@ 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 version = conduwuit_version();
let mut builder = reqwest::Client::builder()
.hickory_dns(true)