feat(tvix/store): set user-agent for NixHTTPPathInfoService
Change-Id: I8eb74c5a9457b88ab51bd88084591a4c7c5cdbcc Reviewed-on: https://cl.tvl.fyi/c/depot/+/12849 Reviewed-by: Domen Kožar <domen@cachix.org> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
parent
b59561b9b1
commit
fa305dea90
2 changed files with 11 additions and 3 deletions
|
@ -9,6 +9,9 @@ pub mod utils;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
|
// Used as user agent in various HTTP Clients
|
||||||
|
const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));
|
||||||
|
|
||||||
// That's what the rstest_reuse README asks us do, and fails about being unable
|
// That's what the rstest_reuse README asks us do, and fails about being unable
|
||||||
// to find rstest_reuse in crate root.
|
// to find rstest_reuse in crate root.
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
|
@ -54,7 +54,12 @@ impl<BS, DS> NixHTTPPathInfoService<BS, DS> {
|
||||||
Self {
|
Self {
|
||||||
instance_name,
|
instance_name,
|
||||||
base_url,
|
base_url,
|
||||||
http_client: reqwest_middleware::ClientBuilder::new(reqwest::Client::new())
|
http_client: reqwest_middleware::ClientBuilder::new(
|
||||||
|
reqwest::Client::builder()
|
||||||
|
.user_agent(crate::USER_AGENT)
|
||||||
|
.build()
|
||||||
|
.expect("Client::new()"),
|
||||||
|
)
|
||||||
.with(tvix_tracing::propagate::reqwest::tracing_middleware())
|
.with(tvix_tracing::propagate::reqwest::tracing_middleware())
|
||||||
.build(),
|
.build(),
|
||||||
blob_service,
|
blob_service,
|
||||||
|
|
Loading…
Add table
Reference in a new issue