mirror of
https://github.com/rustfs/rustfs.git
synced 2026-01-16 17:20:33 +00:00
fix: add delete prefix option support (#1471)
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user