Skip to content

Commit

Permalink
fix: hyper-transport url (#488)
Browse files Browse the repository at this point in the history
* fix hyper-transport url
  • Loading branch information
nikolay-komarevskiy authored Nov 15, 2023
1 parent 3cb1c46 commit 081af29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions ic-agent/src/agent/http_transport/hyper_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand All @@ -226,7 +226,7 @@ where
) -> AgentFuture<Vec<u8>> {
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
Expand All @@ -236,7 +236,7 @@ where
fn read_subnet_state(&self, subnet_id: Principal, envelope: Vec<u8>) -> AgentFuture<Vec<u8>> {
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
Expand All @@ -246,7 +246,7 @@ where
fn query(&self, effective_canister_id: Principal, envelope: Vec<u8>) -> AgentFuture<Vec<u8>> {
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
Expand All @@ -255,7 +255,7 @@ where

fn status(&self) -> AgentFuture<Vec<u8>> {
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
})
}
Expand Down

0 comments on commit 081af29

Please sign in to comment.