From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 1448F1FF13F for ; Thu, 12 Mar 2026 13:49:07 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A495D14777; Thu, 12 Mar 2026 13:49:02 +0100 (CET) Message-ID: <556946fe-13dd-4c77-9e93-e3908c1c5850@proxmox.com> Date: Thu, 12 Mar 2026 13:48:58 +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> <2552a0ad-ade6-404a-8010-a09f6b82e3a3@proxmox.com> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <2552a0ad-ade6-404a-8010-a09f6b82e3a3@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773319703145 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.057 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) 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: 4V3RYEATEVB6UTMYWVLG3NX4WFIZ3WJL X-Message-ID-Hash: 4V3RYEATEVB6UTMYWVLG3NX4WFIZ3WJL 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/12/26 1:45 PM, Hannes Laimer wrote: > On 2026-03-12 13:39, Christian Ebner wrote: >> 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. >> > > thanks for taking a look, makes sense! Funnily enough, even this did fix > the problem, I guess it being set at all was enough :P > > I'll send a v2, with this and the one you mentioned updated Yes, some S3 clients seem to default to `binary/octet-stream` though, according to https://github.com/aws/aws-sdk-java/issues/1143 But using the IANA registered content-type is preferable i guess.