Skip to content

Commit

Permalink
feat: retrieve package version at build time
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanccn committed Oct 16, 2023
1 parent 71fcfc1 commit 254a5b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/reqwest_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ pub static HTTP: Lazy<reqwest::Client> = Lazy::new(|| {
let mut builder = reqwest::ClientBuilder::new();

let mut headers = header::HeaderMap::new();

let user_agent = format!("valfisk/{}", env!("CARGO_PKG_VERSION"));
headers.insert(
"user-agent",
header::HeaderValue::from_static("valfisk/0.1.0"),
header::HeaderValue::from_str(&user_agent).unwrap(),
);
builder = builder.default_headers(headers);

Expand Down

0 comments on commit 254a5b6

Please sign in to comment.