refactor: move HTTP range helper contracts (#3533)

This commit is contained in:
安正超
2026-06-18 00:47:23 +08:00
committed by GitHub
parent cc84d9065e
commit 53337a6f71
27 changed files with 270 additions and 150 deletions
+1 -1
View File
@@ -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,
+3 -3
View File
@@ -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()));
+1 -1
View File
@@ -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,