mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-28 16:07:05 +00:00
@@ -792,11 +792,6 @@ impl S3 for FS {
|
|||||||
};
|
};
|
||||||
let last_modified = info.mod_time.map(Timestamp::from);
|
let last_modified = info.mod_time.map(Timestamp::from);
|
||||||
|
|
||||||
let body = Some(StreamingBlob::wrap(bytes_stream(
|
|
||||||
ReaderStream::with_capacity(reader.stream, DEFAULT_READ_BUFFER_SIZE),
|
|
||||||
info.size as usize,
|
|
||||||
)));
|
|
||||||
|
|
||||||
let mut rs = rs;
|
let mut rs = rs;
|
||||||
|
|
||||||
if let Some(part_number) = part_number {
|
if let Some(part_number) = part_number {
|
||||||
@@ -805,20 +800,25 @@ impl S3 for FS {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut content_length = Some(info.size as i64);
|
let mut content_length = info.size as i64;
|
||||||
|
|
||||||
let content_range = if let Some(rs) = rs {
|
let content_range = if let Some(rs) = rs {
|
||||||
let total_size = info.get_actual_size().map_err(ApiError::from)?;
|
let total_size = info.get_actual_size().map_err(ApiError::from)?;
|
||||||
let (start, length) = rs.get_offset_length(total_size as i64).map_err(ApiError::from)?;
|
let (start, length) = rs.get_offset_length(total_size as i64).map_err(ApiError::from)?;
|
||||||
content_length = Some(length);
|
content_length = length;
|
||||||
Some(format!("bytes {}-{}/{}", start, start as i64 + length - 1, total_size))
|
Some(format!("bytes {}-{}/{}", start, start as i64 + length - 1, total_size))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let body = Some(StreamingBlob::wrap(bytes_stream(
|
||||||
|
ReaderStream::with_capacity(reader.stream, DEFAULT_READ_BUFFER_SIZE),
|
||||||
|
content_length as usize,
|
||||||
|
)));
|
||||||
|
|
||||||
let output = GetObjectOutput {
|
let output = GetObjectOutput {
|
||||||
body,
|
body,
|
||||||
content_length,
|
content_length: Some(content_length),
|
||||||
last_modified,
|
last_modified,
|
||||||
content_type,
|
content_type,
|
||||||
accept_ranges: Some("bytes".to_string()),
|
accept_ranges: Some("bytes".to_string()),
|
||||||
|
|||||||
Reference in New Issue
Block a user