mirror of
https://github.com/minio/minio-rs.git
synced 2025-12-06 15:26:51 +08:00
fix: Set user agent always (#52)
This commit is contained in:
parent
e9aea2ada6
commit
8ecabea0d2
@ -7,6 +7,8 @@ description = "MinIO SDK for Amazon S3 compatible object storage access"
|
|||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
repository = "https://github.com/minio/minio-rs"
|
repository = "https://github.com/minio/minio-rs"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
keywords = ["object-storage", "minio", "s3"]
|
||||||
|
categories = ["api-bindings", "web-programming::http-client"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
hyper = { version = "0.14.27", features = ["full"] }
|
hyper = { version = "0.14.27", features = ["full"] }
|
||||||
|
|||||||
@ -265,8 +265,8 @@ impl ClientBuilder {
|
|||||||
|
|
||||||
if let Some((app_name, app_version)) = self.app_info {
|
if let Some((app_name, app_version)) = self.app_info {
|
||||||
user_agent.push_str(format!(" {app_name}/{app_version}").as_str());
|
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 {
|
if let Some(v) = self.ignore_cert_check {
|
||||||
builder = builder.danger_accept_invalid_certs(v);
|
builder = builder.danger_accept_invalid_certs(v);
|
||||||
@ -342,10 +342,6 @@ impl Client {
|
|||||||
data: &[u8],
|
data: &[u8],
|
||||||
) {
|
) {
|
||||||
headers.insert(String::from("Host"), url.host_header_value());
|
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 md5sum = String::new();
|
||||||
let mut sha256 = String::new();
|
let mut sha256 = String::new();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user