From 897b6287ce0c1dde876e006ce6a98e4a1edbbb6d Mon Sep 17 00:00:00 2001 From: catcatmu <3618380+catcatmu@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:41:41 -0500 Subject: [PATCH] Fixed: S3 multipart uploads does not set file metadata --- 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 19bdbfdf7209..2f9a359c770d 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);