public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox] s3-client: copy_object: always set Content-Type header
@ 2026-03-11  9:56 Hannes Laimer
  2026-03-12 12:39 ` Christian Ebner
  2026-03-16 14:21 ` superseded: " Hannes Laimer
  0 siblings, 2 replies; 5+ messages in thread
From: Hannes Laimer @ 2026-03-11  9:56 UTC (permalink / raw)
  To: pbs-devel

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(&copy_source)?)
+            .header(header::CONTENT_TYPE, "binary/octet-stream")
             .header(
                 "x-amz-metadata-directive",
                 HeaderValue::from_str("REPLACE")?,
-- 
2.47.3





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-16 14:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-11  9:56 [PATCH proxmox] s3-client: copy_object: always set Content-Type header Hannes Laimer
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal