Skip to content

Commit

Permalink
fix: check in http_client.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukevmorris committed Nov 9, 2024
1 parent 6234221 commit 34781e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/cache/http_client.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use opendal::raw::HttpClient;
use reqwest::ClientBuilder;

/// Set the user agent (helps with monitoring on the server side)
pub fn set_user_agent() -> HttpClient {
let user_agent = format!("{}/{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));
let client = ClientBuilder::new().user_agent(user_agent).build().unwrap();
HttpClient::with(client)
}

0 comments on commit 34781e0

Please sign in to comment.