From 33f245d7dd20effba74b221f789af52d1c86369a Mon Sep 17 00:00:00 2001 From: boyu Date: Fri, 11 Oct 2024 04:29:30 +0000 Subject: [PATCH] Stop trimming the path of the coordinator url --- prover/src/coordinator_client/api.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/prover/src/coordinator_client/api.rs b/prover/src/coordinator_client/api.rs index 905a1e61c5..5e1880d044 100644 --- a/prover/src/coordinator_client/api.rs +++ b/prover/src/coordinator_client/api.rs @@ -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, } @@ -31,7 +31,7 @@ impl Api { .build(); Ok(Self { - url_base: Url::parse(url_base)?, + url_base: url_base.to_string(), send_timeout, client, }) @@ -139,6 +139,9 @@ impl Api { } fn build_url(&self, method: &str) -> Result { - 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)) } }