rust-s3
rust-s3 copied to clipboard
*_with_content_type functions not setting content type on S3
Describe the bug It seems that the put_object_with_content_type and put_object_stream_with_content_type methods are not setting the content type for uploaded objects on S3
To Reproduce A minimal test which shows the issue
use s3::{bucket::Bucket, creds::Credentials};
use tokio::fs::File;
#[tokio::main]
async fn main() {
let mut file = File::open("/path/to/image.jpg")
.await
.unwrap();
let region: s3::Region = "us-west-2".parse().unwrap();
let credentials = Credentials::default().unwrap();
let bucket = Bucket::new("bucket-name", region, credentials).unwrap();
let content_type = "image/jpeg";
bucket
.put_object_stream_with_content_type(&mut file, "test/file2", content_type)
.await;
}
Expected behavior
I would expect this to show image/jpeg on the AWS web ui but instead it shows
Environment
- Rust version: rustc 1.64.0 (a55dd71d5 2022-09-19)
- lib version 0.32.3