Tolerate ending / in Consul address

This commit is contained in:
Alex 2021-12-08 12:10:58 +01:00
parent 7599dfc0ef
commit 8a4778c6bc
No known key found for this signature in database
GPG Key ID: EDABF9711E244EB1
2 changed files with 2 additions and 2 deletions

View File

@ -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(),
};

View File

@ -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,