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 9590D1FF13A for ; Wed, 15 Apr 2026 10:53:51 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1EF7797BB; Wed, 15 Apr 2026 10:53:51 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 15 Apr 2026 10:53:46 +0200 Message-Id: Subject: Re: [PATCH installer v3 26/38] common: http: allow passing custom headers to post() From: "Christoph Heiss" To: "Lukas Wagner" X-Mailer: aerc 0.21.0 References: <20260403165437.2166551-1-c.heiss@proxmox.com> <20260403165437.2166551-27-c.heiss@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1776243149238 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.069 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_VALIDITY_CERTIFIED_BLOCKED 0.001 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.001 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.001 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: QU4RUTX66DYL3S6CPSRZSOIBDPNKKKI6 X-Message-ID-Hash: QU4RUTX66DYL3S6CPSRZSOIBDPNKKKI6 X-MailFrom: c.heiss@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 CC: pdm-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Thanks for the review! On Tue Apr 14, 2026 at 2:13 PM CEST, Lukas Wagner wrote: > On Fri Apr 3, 2026 at 6:53 PM CEST, Christoph Heiss wrote: >> Add an additional parameter to allow passing in additional headers. >> >> No functional changes. >> >> Signed-off-by: Christoph Heiss > > [...] > >> +/// >> +/// # Returns >> +/// >> +/// A tuple containing >> +/// * The body contents, as returned by the server >> +/// * The content type of the response, if set in the response headers >> +pub fn post( >> + url: &str, >> + fingerprint: Option<&str>, >> + headers: header::HeaderMap, >> + payload: String, >> +) -> Result<(String, Option)> { > > Maybe a custom type for the response would be a bit nicer here, instead > of the tuple? Yeah, makes sense, I'll change it for v4. At the very least, it makes the whole thing a lot more self-documenting/less opaque. [..] > >> >> /// Information about the system boot status. >> #[derive(Serialize)] >> @@ -536,11 +537,7 @@ impl PostHookInfo { >> .map(|v| { >> // /proc/version: "Linux version 6.17.2-1-pve (...) #1 = SMP ..." >> // extract everything after the second space >> - v.splitn(3, ' ') >> - .nth(2) >> - .unwrap_or("") >> - .trim() >> - .to_owned() >> + v.splitn(3, ' ').nth(2).unwrap_or("").trim().to_owned() >> }) >> .unwrap_or_default(); >> >> @@ -640,16 +637,12 @@ impl PostHookInfo { >> sockets.insert(value); >> } >> // x86: "flags", ARM64: "Features" >> - Some((key, value)) >> - if key.trim() =3D=3D "flags" >> - || key.trim() =3D=3D "Features" =3D> >> - { >> + Some((key, value)) if key.trim() =3D=3D "flags" || key.= trim() =3D=3D "Features" =3D> { >> value.trim().clone_into(&mut result.flags); >> } >> // x86: "model name", ARM64: "CPU implementer" >> Some((key, value)) >> - if key.trim() =3D=3D "model name" >> - || key.trim() =3D=3D "CPU implementer" =3D> >> + if key.trim() =3D=3D "model name" || key.trim() =3D= =3D "CPU implementer" =3D> >> { > > These seem to be unrelated changes caused by your auto-formatter, maybe > split these out into a separate patch? Yes, definitely, they should not have slipped it! Probably happened somewhere during rebasing.