From 23ff1d2409fc61298ef92079495d240f843df6ab Mon Sep 17 00:00:00 2001 From: Dmitry Pankratov Date: Thu, 9 Jan 2025 20:13:46 +0100 Subject: [PATCH] Minor code fix --- snxcore/src/ccc.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/snxcore/src/ccc.rs b/snxcore/src/ccc.rs index 75fced3..64d7717 100644 --- a/snxcore/src/ccc.rs +++ b/snxcore/src/ccc.rs @@ -141,7 +141,9 @@ impl CccHttpClient { builder = builder.danger_accept_invalid_certs(true); } - let path = if let (true, Some(client_cert)) = (with_cert, &self.params.cert_path) { + let mut path = "/clients/"; + + if let (true, Some(client_cert)) = (with_cert, &self.params.cert_path) { let data = std::fs::read(client_cert)?; let identity = match self.params.cert_type { CertType::Pkcs8 => Some(Identity::from_pkcs8_pem(&data, &data)?), @@ -153,13 +155,9 @@ impl CccHttpClient { }; if let Some(identity) = identity { builder = builder.identity(identity); - "/clients/cert/" - } else { - "/clients/" + path = "/clients/cert/"; } - } else { - "/clients/" - }; + } let client = builder.build()?;