From e64ecbdccd727c7b7f69b3462d16ac025611a886 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 19 Feb 2021 18:51:05 +0100 Subject: [PATCH] S3 compatibility: return 404 instead of 400 on some multipart commands --- src/api/s3_put.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/api/s3_put.rs b/src/api/s3_put.rs index 8ad17cfc..5b5da3d2 100644 --- a/src/api/s3_put.rs +++ b/src/api/s3_put.rs @@ -384,9 +384,7 @@ pub async fn handle_put_part( .iter() .any(|v| v.uuid == version_uuid && v.is_uploading()) { - return Err(Error::BadRequest(format!( - "Multipart upload does not exist or is otherwise invalid" - ))); + return Err(Error::NotFound); } // Copy block to store @@ -438,11 +436,7 @@ pub async fn handle_complete_multipart_upload( .iter() .find(|v| v.uuid == version_uuid && v.is_uploading()); let mut object_version = match object_version { - None => { - return Err(Error::BadRequest(format!( - "Multipart upload does not exist or has already been completed" - ))) - } + None => return Err(Error::NotFound), Some(x) => x.clone(), }; @@ -532,11 +526,7 @@ pub async fn handle_abort_multipart_upload( .iter() .find(|v| v.uuid == version_uuid && v.is_uploading()); let mut object_version = match object_version { - None => { - return Err(Error::BadRequest(format!( - "Multipart upload does not exist or has already been completed" - ))) - } + None => return Err(Error::NotFound), Some(x) => x.clone(), };