From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 827EF1FF13F for ; Thu, 12 Mar 2026 13:40:34 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 353F514427; Thu, 12 Mar 2026 13:40:30 +0100 (CET) Message-ID: Date: Thu, 12 Mar 2026 13:39:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox] s3-client: copy_object: always set Content-Type header To: Hannes Laimer , pbs-devel@lists.proxmox.com References: <20260311095600.73538-1-h.laimer@proxmox.com> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <20260311095600.73538-1-h.laimer@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773319158845 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.008 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.819 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: K5JWWK7Q2APOBLHHMY5BF33X2ACEEDQM X-Message-ID-Hash: K5JWWK7Q2APOBLHHMY5BF33X2ACEEDQM X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 3/11/26 10:56 AM, Hannes Laimer wrote: > 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. This should further state that it only acceptable to set the header unconditionally here, since the current s3 client implementation does set it unconditionally as well. Which however raises the inconsistency as mentioned below. > > Signed-off-by: Hannes Laimer > --- > 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") This should be `application/octet-stream` [0], there is no `binary/octet-stream` according to [1]. While checking this, I did notice the original Content-Type in put_object() is set to `binary/octet` which is also wrong. So both should be fixed and aligned. [0] https://www.iana.org/assignments/media-types/application/octet-stream [1] https://www.iana.org/assignments/media-types/media-types.xhtml > .header( > "x-amz-metadata-directive", > HeaderValue::from_str("REPLACE")?,