From f997cbdaea8364880f3a9b3743131c0ab5a60534 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 1 Dec 2023 07:10:44 -0500 Subject: fix: report user agent in /version correctly --- src/api/mod.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/api') diff --git a/src/api/mod.rs b/src/api/mod.rs index 2ce664e..d9eaef2 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -3,13 +3,15 @@ use once_cell::sync::Lazy; pub mod guzzle; pub mod shiggy; -pub const USER_AGENT: &str = "teawieBot/"; - -pub static REQWEST_CLIENT: Lazy = Lazy::new(|| { +pub static USER_AGENT: Lazy = Lazy::new(|| { let version = option_env!("CARGO_PKG_VERSION").unwrap_or("development"); + format!("teawieBot/{version}") +}); + +pub static REQWEST_CLIENT: Lazy = Lazy::new(|| { reqwest::Client::builder() - .user_agent(format!("{USER_AGENT}/{version}")) + .user_agent(format!("{:#?}", USER_AGENT)) .build() .unwrap_or_default() }); -- cgit v1.2.3