diff options
author | Alex Auvolat <alex@adnab.me> | 2021-02-19 18:51:05 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-02-19 18:51:05 +0100 |
commit | e64ecbdccd727c7b7f69b3462d16ac025611a886 (patch) | |
tree | 6ce73ae0a812bb565db3a363acd1029bd0351a1a | |
parent | 55a2a636ca0f9a3bf849c7116071750544416530 (diff) | |
download | garage-e64ecbdccd727c7b7f69b3462d16ac025611a886.tar.gz garage-e64ecbdccd727c7b7f69b3462d16ac025611a886.zip |
S3 compatibility: return 404 instead of 400 on some multipart commands
-rw-r--r-- | src/api/s3_put.rs | 16 |
1 files 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(), }; |