From f0ace5640c310e5dec3b3d368346442bdc1b7a1d Mon Sep 17 00:00:00 2001 From: catcatmu Date: Thu, 19 Dec 2024 04:23:45 -0500 Subject: [PATCH] fix(core): S3 multipart uploads does not set file metadata (#5430) Fixed: S3 multipart uploads does not set file metadata Co-authored-by: catcatmu <3618380+catcatmu@users.noreply.github.com> --- core/src/services/s3/core.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/services/s3/core.rs b/core/src/services/s3/core.rs index 19bdbfdf720..2f9a359c770 100644 --- a/core/src/services/s3/core.rs +++ b/core/src/services/s3/core.rs @@ -666,6 +666,13 @@ impl S3Core { req = req.header(HeaderName::from_static(constants::X_AMZ_STORAGE_CLASS), v); } + // Set user metadata headers. + if let Some(user_metadata) = args.user_metadata() { + for (key, value) in user_metadata { + req = req.header(format!("{X_AMZ_META_PREFIX}{key}"), value) + } + } + // Set SSE headers. let req = self.insert_sse_headers(req, true);