ConsulConfigurationException throw if URL scheme specified in CONSUL_HTTP_ADDR environment variable.
Closed this issue · 1 comments
This error occurs in this file: https://github.com/PlayFab/consuldotnet/blob/master/Consul/Client.cs
A ConsulConfigurationException
is thrown when constructing an instance of ConsulClientConfiguration
if it finds a value in the environment variable CONSUL_HTTP_ADDR
that includes the URL scheme (http/https).
For example, if the environment variable is set to http://127.0.0.1:8500
it will fail because it is doing a string splint on :
and expected the second part to be the port number, but with this example it is the third part.
It also seems strange that it is checking for this, when the address value just gets overwritten anyway by the default constructor.
Actually, upon reviewing the consul documentation (here: https://www.consul.io/docs/commands/index.html#consul_http_addr) it's recommended not to specify the URL scheme in the environment variable.
Will close this issue