S3 compatibility: return 404 instead of 400 on some multipart commands

This commit is contained in:
Alex Auvolat 2021-02-19 18:51:05 +01:00
parent 55a2a636ca
commit e64ecbdccd

View file

@ -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(),
};