fix: Set user agent always (#52)

This commit is contained in:
Aditya Manthramurthy 2023-09-27 09:04:06 -07:00 committed by GitHub
parent e9aea2ada6
commit 8ecabea0d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -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"] }

View File

@ -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();