From dc23d7d06689ab7a1c3efe985c42f47527c65226 Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 11 Nov 2024 14:15:45 +0300 Subject: [PATCH] prodpath --- src/handlers/proxy.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/handlers/proxy.rs b/src/handlers/proxy.rs index 7ca9c7e..465a3cc 100644 --- a/src/handlers/proxy.rs +++ b/src/handlers/proxy.rs @@ -111,10 +111,14 @@ pub async fn proxy_handler( } } else { warn!("Attempting to load from AWS - bucket: {}, path: {}", state.bucket, stored_path); - + + // Определяем тип медиа из content_type + let media_type = content_type.split("/").next().unwrap_or("image"); + let aws_paths = vec![ stored_path.clone(), - format!("production/{}", stored_path) + format!("production/{}", stored_path), + format!("production/{}/{}", media_type, stored_path) ]; for path in aws_paths {