Tolerate ending / in Consul address
This commit is contained in:
parent
7599dfc0ef
commit
8a4778c6bc
2 changed files with 2 additions and 2 deletions
|
@ -79,7 +79,7 @@ impl Consul {
|
||||||
pub fn new(url: &str, kv_prefix: &str, local_node: &str) -> Self {
|
pub fn new(url: &str, kv_prefix: &str, local_node: &str) -> Self {
|
||||||
return Self {
|
return Self {
|
||||||
client: reqwest::Client::new(),
|
client: reqwest::Client::new(),
|
||||||
url: url.to_string(),
|
url: url.trim_end_matches('/').to_string(),
|
||||||
kv_prefix: kv_prefix.to_string(),
|
kv_prefix: kv_prefix.to_string(),
|
||||||
local_node: local_node.into(),
|
local_node: local_node.into(),
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,7 +21,7 @@ struct Opt {
|
||||||
#[structopt(
|
#[structopt(
|
||||||
long = "consul-addr",
|
long = "consul-addr",
|
||||||
env = "TRICOT_CONSUL_HOST",
|
env = "TRICOT_CONSUL_HOST",
|
||||||
default_value = "http://127.0.0.1:8500/"
|
default_value = "http://127.0.0.1:8500"
|
||||||
)]
|
)]
|
||||||
pub consul_addr: String,
|
pub consul_addr: String,
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue