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 BF34A1FF13F for ; Thu, 12 Mar 2026 13:46:32 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 749E2146EB; Thu, 12 Mar 2026 13:46:28 +0100 (CET) Message-ID: <2552a0ad-ade6-404a-8010-a09f6b82e3a3@proxmox.com> Date: Thu, 12 Mar 2026 13:45:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox] s3-client: copy_object: always set Content-Type header To: Christian Ebner , pbs-devel@lists.proxmox.com References: <20260311095600.73538-1-h.laimer@proxmox.com> Content-Language: en-US From: Hannes Laimer In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773319517381 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.994 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: RNFCBBFTCAM4BM6WQEO7K2BCJIH6LDJ2 X-Message-ID-Hash: RNFCBBFTCAM4BM6WQEO7K2BCJIH6LDJ2 X-MailFrom: h.laimer@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 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 > [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")?, >