add user agent to oidc requests (#701)

Co-authored-by: eleith <online-github@eleith.com>
This commit is contained in:
eleith
2025-08-02 17:16:28 -07:00
committed by GitHub
parent 3c89a72841
commit 160709788a

View File

@@ -31,11 +31,17 @@ use super::RedirectQuery;
pub mod client;
static APP_USER_AGENT: &str = concat!(
"Komodo/",
env!("CARGO_PKG_VERSION"),
);
fn reqwest_client() -> &'static reqwest::Client {
static REQWEST: OnceLock<reqwest::Client> = OnceLock::new();
REQWEST.get_or_init(|| {
reqwest::Client::builder()
.redirect(reqwest::redirect::Policy::none())
.user_agent(APP_USER_AGENT)
.build()
.expect("Invalid OIDC reqwest client")
})