fix(s3): list multipart uploads by bucket prefix (#5195)

* fix(s3): list multipart uploads by bucket prefix

* fix(s3): preserve exact-key crash reclamation
This commit is contained in:
cxymds
2026-07-24 21:28:06 +08:00
committed by GitHub
parent dd46de0945
commit fa235e9018
6 changed files with 556 additions and 155 deletions
+7 -4
View File
@@ -310,10 +310,8 @@ pub fn check_list_multipart_args(
) -> Result<()> {
check_list_objs_args(bucket, prefix, key_marker)?;
if let Some(upload_id_marker) = upload_id_marker {
if let Some(key_marker) = key_marker
&& key_marker.ends_with('/')
{
if let (Some(key_marker), Some(upload_id_marker)) = (key_marker, upload_id_marker) {
if key_marker.ends_with('/') {
return Err(StorageError::InvalidUploadIDKeyCombination(
upload_id_marker.to_string(),
key_marker.to_string(),
@@ -629,6 +627,11 @@ mod tests {
assert!(check_list_objs_args("INVALID", "", &None).is_err());
}
#[test]
fn test_list_multipart_upload_marker_is_ignored_without_key_marker() {
assert!(check_list_multipart_args("valid-bucket", "", &None, &Some("not-base64!".to_string()), &None,).is_ok());
}
#[test]
fn test_check_multipart_args() {
assert!(check_new_multipart_args("valid-bucket", "valid-object").is_ok());