mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-12 16:16:55 +00:00
refactor: move HTTP range helper contracts (#3533)
This commit is contained in:
@@ -300,7 +300,7 @@ async fn create_dlo_stream(
|
||||
|
||||
async move {
|
||||
let range_spec = if byte_start > 0 || byte_end < segment.size as u64 - 1 {
|
||||
Some(rustfs_ecstore::store_api::HTTPRangeSpec {
|
||||
Some(rustfs_storage_api::HTTPRangeSpec {
|
||||
is_suffix_length: false,
|
||||
start: byte_start as i64,
|
||||
end: byte_end as i64,
|
||||
|
||||
@@ -533,7 +533,7 @@ pub async fn get_object(
|
||||
container: &str,
|
||||
object: &str,
|
||||
credentials: &Credentials,
|
||||
range: Option<rustfs_ecstore::store_api::HTTPRangeSpec>,
|
||||
range: Option<rustfs_storage_api::HTTPRangeSpec>,
|
||||
) -> SwiftResult<rustfs_ecstore::store_api::GetObjectReader> {
|
||||
use rustfs_ecstore::store_api::GetObjectReader;
|
||||
|
||||
@@ -1032,8 +1032,8 @@ pub fn parse_copy_from_header(copy_from: &str) -> SwiftResult<(String, String)>
|
||||
/// assert_eq!(range.end, 1023);
|
||||
/// ```
|
||||
#[allow(dead_code)] // Handler integration: Range header
|
||||
pub fn parse_range_header(range_str: &str) -> SwiftResult<rustfs_ecstore::store_api::HTTPRangeSpec> {
|
||||
use rustfs_ecstore::store_api::HTTPRangeSpec;
|
||||
pub fn parse_range_header(range_str: &str) -> SwiftResult<rustfs_storage_api::HTTPRangeSpec> {
|
||||
use rustfs_storage_api::HTTPRangeSpec;
|
||||
|
||||
if !range_str.starts_with("bytes=") {
|
||||
return Err(SwiftError::BadRequest("Range header must start with 'bytes='".to_string()));
|
||||
|
||||
@@ -420,7 +420,7 @@ async fn create_slo_stream(
|
||||
|
||||
// Fetch segment with range
|
||||
let range_spec = if byte_start > 0 || byte_end < segment.size_bytes - 1 {
|
||||
Some(rustfs_ecstore::store_api::HTTPRangeSpec {
|
||||
Some(rustfs_storage_api::HTTPRangeSpec {
|
||||
is_suffix_length: false,
|
||||
start: byte_start as i64,
|
||||
end: byte_end as i64,
|
||||
|
||||
Reference in New Issue
Block a user