fix(build): scope migration helpers to their features (#7234)

* test(odm): keep listing header import test scoped

* fix(build): gate GCS-only migration HTTP helpers
This commit is contained in:
Zhengchao An
2026-09-06 02:24:04 +08:00
committed by GitHub
parent ea9aa53fd8
commit 112f70914d
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -38,7 +38,6 @@ use crate::on_demand_migration::{
SourceListRequest, SourceObject, SourcePage, decode_continuation_token, source_list_plan,
};
use futures::StreamExt;
use http::HeaderMap;
use rustfs_utils::http::{SUFFIX_SOURCE_PROXY_REQUEST, get_header};
use std::sync::Arc;
use std::time::Instant;
@@ -476,6 +475,7 @@ mod tests {
FilterConfig, MAX_LIST_NO_PROGRESS_PAGES, OnDemandMigrationConfig, PathStyle, PolicyConfig, Provider, SourceConfig,
SourceCredentials, TlsConfig,
};
use http::HeaderMap;
use std::time::Duration;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
@@ -133,6 +133,7 @@ impl NativeHttp {
self.send_classified(request, error_code_header, false).await
}
#[cfg(feature = "gcs")]
pub(super) async fn send_object(
&self,
request: reqwest::Request,
@@ -210,6 +211,7 @@ pub(super) async fn read_text(response: reqwest::Response, max_bytes: usize) ->
/// Base64 digest (`Content-MD5`, `md5Hash`, `x-goog-hash`) as lowercase hex.
/// `None` when the value is not a 16-byte digest, so a CRC32C never passes as
/// an MD5.
#[cfg(any(test, feature = "gcs"))]
pub(super) fn base64_md5_to_hex(value: &str) -> Option<String> {
let raw = base64_simd::STANDARD.decode_to_vec(value.trim().as_bytes()).ok()?;
(raw.len() == 16).then(|| faster_hex::hex_string(&raw))