Update rust-s3 dependency and move Cargo.toml dependencies

This commit is contained in:
Alex Auvolat
2023-05-12 12:12:32 +02:00
parent 30a3cec87e
commit 10e06737cf
6 changed files with 120 additions and 110 deletions
+2 -5
View File
@@ -264,14 +264,11 @@ pub fn plume_media_files(file: PathBuf) -> Option<CachedFile> {
.and_then(|ext| ContentType::from_extension(&ext.to_string_lossy()))
.unwrap_or(ContentType::Binary);
let (data, code) = config.get_bucket()
let data = config.get_bucket()
.get_object_blocking(format!("plume-media/{}", file.to_string_lossy())).ok()?;
if code != 200 {
return None;
}
Some(CachedFile {
inner: FileKind::S3 ( data, ct),
inner: FileKind::S3 ( data.to_vec(), ct),
cache_control: CacheControl(vec![CacheDirective::MaxAge(60 * 60 * 24 * 30)]),
})
} else {