diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ac7305f..aa6f5b7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +* Fixed `HyperTransport` endpoint construction (`//` in the format `/api/v2//canister/5v3p4-iyaaa-aaaaa-qaaaa-cai/query`) ## [0.30.0] - 2023-11-07 diff --git a/ic-agent/src/agent/http_transport/hyper_transport.rs b/ic-agent/src/agent/http_transport/hyper_transport.rs index d118b1e0..c5b1f5ce 100644 --- a/ic-agent/src/agent/http_transport/hyper_transport.rs +++ b/ic-agent/src/agent/http_transport/hyper_transport.rs @@ -211,7 +211,7 @@ where ) -> AgentFuture<()> { Box::pin(async move { let url = format!( - "{}/canister/{effective_canister_id}/call", + "{}canister/{effective_canister_id}/call", self.route_provider.route()? ); self.request(Method::POST, url, Some(envelope)).await?; @@ -226,7 +226,7 @@ where ) -> AgentFuture> { Box::pin(async move { let url = format!( - "{}/canister/{effective_canister_id}/read_state", + "{}canister/{effective_canister_id}/read_state", self.route_provider.route()? ); self.request(Method::POST, url, Some(envelope)).await @@ -236,7 +236,7 @@ where fn read_subnet_state(&self, subnet_id: Principal, envelope: Vec) -> AgentFuture> { Box::pin(async move { let url = format!( - "{}/subnet/{subnet_id}/read_state", + "{}subnet/{subnet_id}/read_state", self.route_provider.route()? ); self.request(Method::POST, url, Some(envelope)).await @@ -246,7 +246,7 @@ where fn query(&self, effective_canister_id: Principal, envelope: Vec) -> AgentFuture> { Box::pin(async move { let url = format!( - "{}/canister/{effective_canister_id}/query", + "{}canister/{effective_canister_id}/query", self.route_provider.route()? ); self.request(Method::POST, url, Some(envelope)).await @@ -255,7 +255,7 @@ where fn status(&self) -> AgentFuture> { Box::pin(async move { - let url = format!("{}/status", self.route_provider.route()?); + let url = format!("{}status", self.route_provider.route()?); self.request(Method::GET, url, None).await }) }