From: Hannes Laimer <h.laimer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox] s3-client: copy_object: always set Content-Type header
Date: Wed, 11 Mar 2026 10:56:00 +0100 [thread overview]
Message-ID: <20260311095600.73538-1-h.laimer@proxmox.com> (raw)
Some S3 providers drop all source metadata, including Content-Type,
when using x-amz-metadata-directive REPLACE unless it is explicitly
provided in the copy request. This caused s3_refresh to fail with
"missing header 'content-type'" on such providers when fetching
objects moved via copy_object.
Setting Content-Type explicitly is a no-op for providers that already
preserve it, so this is safe regardless of the provider.
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
did notice this with RustFS, MinIO did not have that problem
proxmox-s3-client/src/client.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/proxmox-s3-client/src/client.rs b/proxmox-s3-client/src/client.rs
index 81645716..baa8345e 100644
--- a/proxmox-s3-client/src/client.rs
+++ b/proxmox-s3-client/src/client.rs
@@ -602,6 +602,7 @@ impl S3Client {
.method(Method::PUT)
.uri(self.build_uri(&destination_key, &[])?)
.header("x-amz-copy-source", HeaderValue::from_str(©_source)?)
+ .header(header::CONTENT_TYPE, "binary/octet-stream")
.header(
"x-amz-metadata-directive",
HeaderValue::from_str("REPLACE")?,
--
2.47.3
next reply other threads:[~2026-03-11 9:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 9:56 Hannes Laimer [this message]
2026-03-12 12:39 ` Christian Ebner
2026-03-12 12:45 ` Hannes Laimer
2026-03-12 12:48 ` Christian Ebner
2026-03-16 14:21 ` superseded: " Hannes Laimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260311095600.73538-1-h.laimer@proxmox.com \
--to=h.laimer@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.