main: add hostname to user-agent req header

This commit is contained in:
Astro 2023-10-18 17:18:22 +02:00
parent 7f91afa35e
commit 02680ffdac

View file

@ -344,10 +344,11 @@ async fn main() {
} }
let client = reqwest::Client::builder() let client = reqwest::Client::builder()
.timeout(Duration::from_secs(5)) .timeout(Duration::from_secs(5))
.user_agent(concat!( .user_agent(format!(
"{}/{} (+https://{})",
env!("CARGO_PKG_NAME"), env!("CARGO_PKG_NAME"),
"/",
env!("CARGO_PKG_VERSION"), env!("CARGO_PKG_VERSION"),
config.hostname,
)) ))
.pool_max_idle_per_host(1) .pool_max_idle_per_host(1)
.pool_idle_timeout(Some(Duration::from_secs(5))) .pool_idle_timeout(Some(Duration::from_secs(5)))