From 9b2fa3ac6b9d1ae3603d6197cf9f7d624a025e09 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 23 Oct 2024 17:20:25 +0300 Subject: [PATCH] origext-fix --- src/handlers/proxy.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/handlers/proxy.rs b/src/handlers/proxy.rs index 1ffd8dd..4a04b7c 100644 --- a/src/handlers/proxy.rs +++ b/src/handlers/proxy.rs @@ -92,6 +92,7 @@ pub async fn proxy_handler( warn!("serve new thumb file: {}", thumb_filename); serve_file(thumb_filename, &state).await } else { + error!("cannot generate thumbnail"); Err(ErrorInternalServerError( "cannot generate thumbnail", )) @@ -121,7 +122,7 @@ pub async fn proxy_handler( content_type, ) .await { - warn!("cannot upload to storj: {}", e); + error!("cannot upload to storj: {}", e); } else { warn!("file {} uploaded to storj", filekey); } @@ -139,7 +140,7 @@ pub async fn proxy_handler( Ok(None) => { warn!("cannot find stored path for: {}", filekey); let ct_parts = content_type.split("/").collect::>(); - let filepath = format!("production/{}/{}", ct_parts[0], filekey); + let filepath = format!("production/{}/{}.{}", ct_parts[0], base_filename, extension); // NOTE: original ext match check_file_exists(&state.storj_client, &state.bucket, &filepath).await? { true => {