fix: add delete prefix option support (#1471)

This commit is contained in:
weisd
2026-01-12 11:19:09 +08:00
committed by GitHub
parent 760cb1d734
commit 78b13f3ff2

View File

@@ -18,6 +18,7 @@ use rustfs_ecstore::error::Result;
use rustfs_ecstore::error::StorageError;
use rustfs_utils::http::AMZ_META_UNENCRYPTED_CONTENT_LENGTH;
use rustfs_utils::http::AMZ_META_UNENCRYPTED_CONTENT_MD5;
use rustfs_utils::http::RUSTFS_FORCE_DELETE;
use s3s::header::X_AMZ_OBJECT_LOCK_MODE;
use s3s::header::X_AMZ_OBJECT_LOCK_RETAIN_UNTIL_DATE;
@@ -77,6 +78,11 @@ pub async fn del_opts(
StorageError::InvalidArgument(bucket.to_owned(), object.to_owned(), err.to_string())
})?;
opts.delete_prefix = headers
.get(RUSTFS_FORCE_DELETE)
.map(|v| v.to_str().unwrap() == "true")
.unwrap_or_default();
opts.version_id = {
if is_dir_object(object) && vid.is_none() {
Some(Uuid::nil().to_string())