origext-fix
All checks were successful
deploy / deploy (push) Successful in 1m1s

This commit is contained in:
Untone 2024-10-23 17:20:25 +03:00
parent 7fc29f6b7e
commit 9b2fa3ac6b

View File

@ -92,6 +92,7 @@ pub async fn proxy_handler(
warn!("serve new thumb file: {}", thumb_filename); warn!("serve new thumb file: {}", thumb_filename);
serve_file(thumb_filename, &state).await serve_file(thumb_filename, &state).await
} else { } else {
error!("cannot generate thumbnail");
Err(ErrorInternalServerError( Err(ErrorInternalServerError(
"cannot generate thumbnail", "cannot generate thumbnail",
)) ))
@ -121,7 +122,7 @@ pub async fn proxy_handler(
content_type, content_type,
) )
.await { .await {
warn!("cannot upload to storj: {}", e); error!("cannot upload to storj: {}", e);
} else { } else {
warn!("file {} uploaded to storj", filekey); warn!("file {} uploaded to storj", filekey);
} }
@ -139,7 +140,7 @@ pub async fn proxy_handler(
Ok(None) => { Ok(None) => {
warn!("cannot find stored path for: {}", filekey); warn!("cannot find stored path for: {}", filekey);
let ct_parts = content_type.split("/").collect::<Vec<&str>>(); let ct_parts = content_type.split("/").collect::<Vec<&str>>();
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? { match check_file_exists(&state.storj_client, &state.bucket, &filepath).await? {
true => { true => {