Skip to content

Commit

Permalink
Merge pull request #162 from Its-Just-Nans/user-agent-version
Browse files Browse the repository at this point in the history
add version in user agent
  • Loading branch information
podusowski authored Jun 16, 2024
2 parents 2575d84 + 836d892 commit 7b6a2a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion walkers/src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ impl Default for HttpOptions {
fn default() -> Self {
Self {
cache: None,
user_agent: HeaderValue::from_static("Walkers"),
user_agent: HeaderValue::from_static(concat!(
env!("CARGO_PKG_NAME"),
"/",
env!("CARGO_PKG_VERSION"),
)),
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion walkers/src/tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ mod tests {
let request = anticipated.expect().await;
assert_eq!(
request.headers().get(header::USER_AGENT),
Some(&HeaderValue::from_static("Walkers"))
Some(&HeaderValue::from_static(concat!(
"walkers",
"/",
env!("CARGO_PKG_VERSION"),
)))
);

// Eventually it gets downloaded and become available in cache.
Expand Down

0 comments on commit 7b6a2a0

Please sign in to comment.