From 8bc5caf7aa9bc0e27b741c68113cb7fdde2d54e6 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 18 Oct 2022 21:17:11 +0200 Subject: Fix issue with 'http(s)://' prefix --- src/rpc/consul.rs | 6 +++--- src/util/config.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/rpc/consul.rs b/src/rpc/consul.rs index cf050207..b1772a1a 100644 --- a/src/rpc/consul.rs +++ b/src/rpc/consul.rs @@ -100,8 +100,8 @@ impl ConsulDiscovery { pub async fn get_consul_nodes(&self) -> Result, ConsulError> { let url = format!( - "http://{}/v1/catalog/service/{}", - self.config.consul_host, self.config.service_name + "{}/v1/catalog/service/{}", + self.config.consul_http_addr, self.config.service_name ); let http = self.client.get(&url).send().await?; @@ -158,7 +158,7 @@ impl ConsulDiscovery { }, }; - let url = format!("http://{}/v1/catalog/register", self.config.consul_host); + let url = format!("{}/v1/catalog/register", self.config.consul_http_addr); let http = self.client.put(&url).json(&advertisement).send().await?; http.error_for_status()?; diff --git a/src/util/config.rs b/src/util/config.rs index a85e025f..04f8375a 100644 --- a/src/util/config.rs +++ b/src/util/config.rs @@ -128,8 +128,8 @@ pub struct AdminConfig { #[derive(Deserialize, Debug, Clone)] pub struct ConsulDiscoveryConfig { - /// Consul host to connect to to discover more peers - pub consul_host: String, + /// Consul http or https address to connect to to discover more peers + pub consul_http_addr: String, /// Consul service name to use pub service_name: String, /// CA TLS certificate to use when connecting to Consul -- cgit v1.2.3