~ololduck/Frogue
feat: set HTTP client's User-Agent
Browse the tree at this commit
1 file changed, +14, −3
frogue/src/lib.rs+14−3
@@ -357,9 +357,20 @@ pub async fn run() -> miette::Result<()> {
repo_root,
ssh: ssh::settings(ssh_bind_addr),
public_url,
− http_client: reqwest_middleware::ClientBuilder::new(reqwest::Client::new())
− .with(reqwest_tracing::TracingMiddleware::default())
− .build(),
+ http_client: reqwest_middleware::ClientBuilder::new(
+ reqwest::Client::builder()
+ .user_agent(concat!(
+ env!("CARGO_PKG_NAME"),
+ "/",
+ env!("CARGO_PKG_VERSION"),
+ " +",
+ env!("CARGO_PKG_REPOSITORY")
+ ))
+ .build()
+ .into_diagnostic()?,
+ )
+ .with(reqwest_tracing::TracingMiddleware::default())
+ .build(),
}));
ssh::serve(ssh_listener, ssh_config, app_state.clone(), ssh_throttle)?;