From 8a4778c6bc28403f85a68c420709d2758c7378c4 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 8 Dec 2021 12:10:58 +0100 Subject: [PATCH] Tolerate ending / in Consul address --- src/consul.rs | 2 +- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/consul.rs b/src/consul.rs index 1b94dd0..6750ba0 100644 --- a/src/consul.rs +++ b/src/consul.rs @@ -79,7 +79,7 @@ impl Consul { pub fn new(url: &str, kv_prefix: &str, local_node: &str) -> Self { return Self { client: reqwest::Client::new(), - url: url.to_string(), + url: url.trim_end_matches('/').to_string(), kv_prefix: kv_prefix.to_string(), local_node: local_node.into(), }; diff --git a/src/main.rs b/src/main.rs index 79c366b..481fe35 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,7 @@ struct Opt { #[structopt( long = "consul-addr", env = "TRICOT_CONSUL_HOST", - default_value = "http://127.0.0.1:8500/" + default_value = "http://127.0.0.1:8500" )] pub consul_addr: String,