mirror of
https://github.com/rustfs/rustfs.git
synced 2026-01-16 17:20:33 +00:00
Fix/objectdelete (#917)
* fix getobject content length resp * fix delete object --------- Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -615,7 +615,7 @@ impl FileMeta {
|
||||
}
|
||||
}
|
||||
|
||||
let mut update_version = fi.mark_deleted;
|
||||
let mut update_version = false;
|
||||
if fi.version_purge_status().is_empty()
|
||||
&& (fi.delete_marker_replication_status() == ReplicationStatusType::Replica
|
||||
|| fi.delete_marker_replication_status() == ReplicationStatusType::Empty)
|
||||
@@ -1708,7 +1708,7 @@ impl MetaObject {
|
||||
}
|
||||
|
||||
pub fn into_fileinfo(&self, volume: &str, path: &str, all_parts: bool) -> FileInfo {
|
||||
// let version_id = self.version_id.filter(|&vid| !vid.is_nil());
|
||||
let version_id = self.version_id.filter(|&vid| !vid.is_nil());
|
||||
|
||||
let parts = if all_parts {
|
||||
let mut parts = vec![ObjectPartInfo::default(); self.part_numbers.len()];
|
||||
@@ -1812,7 +1812,7 @@ impl MetaObject {
|
||||
.unwrap_or_default();
|
||||
|
||||
FileInfo {
|
||||
version_id: self.version_id,
|
||||
version_id,
|
||||
erasure,
|
||||
data_dir: self.data_dir,
|
||||
mod_time: self.mod_time,
|
||||
|
||||
@@ -1733,10 +1733,10 @@ impl S3 for FS {
|
||||
}
|
||||
}
|
||||
|
||||
let mut content_length = info.size;
|
||||
let mut content_length = info.get_actual_size().map_err(ApiError::from)?;
|
||||
|
||||
let content_range = if let Some(rs) = &rs {
|
||||
let total_size = info.get_actual_size().map_err(ApiError::from)?;
|
||||
let total_size = content_length;
|
||||
let (start, length) = rs.get_offset_length(total_size).map_err(ApiError::from)?;
|
||||
content_length = length;
|
||||
Some(format!("bytes {}-{}/{}", start, start as i64 + length - 1, total_size))
|
||||
|
||||
Reference in New Issue
Block a user