diff --git a/attestation-agent/kbc/src/cc_kbc/mod.rs b/attestation-agent/kbc/src/cc_kbc/mod.rs index 26199fd1d..f87841ffa 100644 --- a/attestation-agent/kbc/src/cc_kbc/mod.rs +++ b/attestation-agent/kbc/src/cc_kbc/mod.rs @@ -66,7 +66,7 @@ impl Kbc { } fn kbs_uri(&self) -> &str { - self.kbs_uri.as_str() + self.kbs_uri.as_str().trim_end_matches('/') } fn kbs_protocol_wrapper(&mut self) -> &mut KbsProtocolWrapper { @@ -93,7 +93,7 @@ impl Kbc { ); } - let kbs_addr = &self.kbs_uri(); + let kbs_addr = self.kbs_uri(); let repo = &resource.repository; let r#type = &resource.r#type; let tag = &resource.tag; diff --git a/attestation-agent/kbs_protocol/src/lib.rs b/attestation-agent/kbs_protocol/src/lib.rs index 13b28d8b0..5f19fe2f6 100644 --- a/attestation-agent/kbs_protocol/src/lib.rs +++ b/attestation-agent/kbs_protocol/src/lib.rs @@ -96,7 +96,7 @@ impl KbsProtocolWrapper { async fn attestation(&mut self, kbs_root_url: String) -> Result { let challenge = self .http_client() - .post(format!("{kbs_root_url}/{KBS_PREFIX}/auth")) + .post(format!("{kbs_root_url}{KBS_PREFIX}/auth")) .header("Content-Type", "application/json") .json(&Request::new(self.tee().to_string())) .send() @@ -107,7 +107,7 @@ impl KbsProtocolWrapper { let attest_response = self .http_client() - .post(format!("{kbs_root_url}/{KBS_PREFIX}/attest")) + .post(format!("{kbs_root_url}{KBS_PREFIX}/attest")) .header("Content-Type", "application/json") .json(&self.generate_evidence()?) .send()