Skip to content

Commit

Permalink
Stop trimming the path of the coordinator url
Browse files Browse the repository at this point in the history
  • Loading branch information
Gigatron committed Oct 11, 2024
1 parent 8780ede commit 33f245d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions prover/src/coordinator_client/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use reqwest_retry::{policies::ExponentialBackoff, RetryTransientMiddleware};
use serde::Serialize;

pub struct Api {
url_base: Url,
url_base: String,
send_timeout: Duration,
pub client: ClientWithMiddleware,
}
Expand All @@ -31,7 +31,7 @@ impl Api {
.build();

Ok(Self {
url_base: Url::parse(url_base)?,
url_base: url_base.to_string(),
send_timeout,
client,
})
Expand Down Expand Up @@ -139,6 +139,9 @@ impl Api {
}

fn build_url(&self, method: &str) -> Result<Url> {
self.url_base.join(method).map_err(|e| anyhow::anyhow!(e))
let full_url = format!("{}/{}",
self.url_base.trim_end_matches('/'),
method.trim_start_matches('/'));
Url::parse(&full_url).map_err(|e| anyhow::anyhow!(e))
}
}

0 comments on commit 33f245d

Please sign in to comment.