From 91c97f3416b143d1e993f58c3ec7148abd92a00a Mon Sep 17 00:00:00 2001 From: GatewayJ <835269233@qq.com> Date: Tue, 18 Aug 2026 21:46:56 +0800 Subject: [PATCH] chore(deps): update s3s to upstream main (#6203) * deps: update s3s to upstream main * deps: refresh s3s upstream revision * deps: pin s3s to latest upstream main --------- Co-authored-by: houseme Co-authored-by: heihutu --- Cargo.lock | 2 +- Cargo.toml | 2 +- rustfs/src/app/metadata_route.rs | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db75a7992..c73ac8d64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10678,7 +10678,7 @@ checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "s3s" version = "0.14.1" -source = "git+https://github.com/rustfs/s3s.git?rev=ff8106f46098b60fce8ee88518f34974fbfbec4b#ff8106f46098b60fce8ee88518f34974fbfbec4b" +source = "git+https://github.com/rustfs/s3s.git?rev=d358a68783096df1db0c3e314127f2704603b29e#d358a68783096df1db0c3e314127f2704603b29e" dependencies = [ "arc-swap", "arrayvec", diff --git a/Cargo.toml b/Cargo.toml index f2080a15f..b6a37b028 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -290,7 +290,7 @@ rustify = { version = "0.7", default-features = false } rustix = { version = "1.1.4" } rust-embed = { version = "8.12.0" } rustc-hash = { version = "2.1.3" } -s3s = { git = "https://github.com/rustfs/s3s.git", rev = "ff8106f46098b60fce8ee88518f34974fbfbec4b" } +s3s = { git = "https://github.com/rustfs/s3s.git", rev = "d358a68783096df1db0c3e314127f2704603b29e" } serial_test = "4.0.1" shadow-rs = { default-features = false, version = "2.0.0" } siphasher = "1.0.3" diff --git a/rustfs/src/app/metadata_route.rs b/rustfs/src/app/metadata_route.rs index d6509f60e..3a49a41e7 100644 --- a/rustfs/src/app/metadata_route.rs +++ b/rustfs/src/app/metadata_route.rs @@ -349,6 +349,30 @@ mod tests { ); } + #[test] + fn metadata_operation_matches_unconfigured_host_fallbacks() { + let host = MultiDomain::new(["s3.example.com", "s3.example.com:9000"]).expect("valid test host domain"); + + let mut path_style_headers = HeaderMap::new(); + path_style_headers.insert(HOST, "localhost:9000".parse().expect("valid host header")); + let path_style = metadata_operation( + &Method::GET, + &uri("/path-bucket?list-type=2&metadata=true"), + &path_style_headers, + Some(&host), + ) + .expect("unmatched host with a port should use path-style routing"); + assert_eq!(path_style.operation, MetadataOperation::ListObjectsV2); + assert_eq!(path_style.bucket, "path-bucket"); + + let mut cname_headers = HeaderMap::new(); + cname_headers.insert(HOST, "cdn.example.org".parse().expect("valid host header")); + let cname = metadata_operation(&Method::GET, &uri("/?list-type=2&metadata=true"), &cname_headers, Some(&host)) + .expect("unmatched valid bucket host should use CNAME routing"); + assert_eq!(cname.operation, MetadataOperation::ListObjectsV2); + assert_eq!(cname.bucket, "cdn.example.org"); + } + #[test] fn list_objects_v2_input_parses_query_headers_and_decodes_bucket() { let mut headers = HeaderMap::new();