From 8ecabea0d21ad437e6c39cb5020ab27f2425edea Mon Sep 17 00:00:00 2001 From: Aditya Manthramurthy Date: Wed, 27 Sep 2023 09:04:06 -0700 Subject: [PATCH] fix: Set user agent always (#52) --- Cargo.toml | 2 ++ src/s3/client.rs | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 534b597..2b78cd8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,8 @@ description = "MinIO SDK for Amazon S3 compatible object storage access" license = "Apache-2.0" repository = "https://github.com/minio/minio-rs" readme = "README.md" +keywords = ["object-storage", "minio", "s3"] +categories = ["api-bindings", "web-programming::http-client"] [dependencies] hyper = { version = "0.14.27", features = ["full"] } diff --git a/src/s3/client.rs b/src/s3/client.rs index f93553b..e26994a 100644 --- a/src/s3/client.rs +++ b/src/s3/client.rs @@ -265,8 +265,8 @@ impl ClientBuilder { if let Some((app_name, app_version)) = self.app_info { user_agent.push_str(format!(" {app_name}/{app_version}").as_str()); - builder = builder.user_agent(user_agent); } + builder = builder.user_agent(user_agent); if let Some(v) = self.ignore_cert_check { builder = builder.danger_accept_invalid_certs(v); @@ -342,10 +342,6 @@ impl Client { data: &[u8], ) { headers.insert(String::from("Host"), url.host_header_value()); - headers.insert( - String::from("User-Agent"), - String::from("MinIO (Linux; x86_64) minio-rs/0.1.0"), - ); let mut md5sum = String::new(); let mut sha256 = String::new();