mirror of
https://github.com/moghtech/komodo.git
synced 2026-04-28 03:38:55 -05:00
add user agent to oidc requests (#701)
Co-authored-by: eleith <online-github@eleith.com>
This commit is contained in:
@@ -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")
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user