diff --git a/Consul.Test/ClientTest.cs b/Consul.Test/ClientTest.cs index ed36e840..a9009b52 100644 --- a/Consul.Test/ClientTest.cs +++ b/Consul.Test/ClientTest.cs @@ -43,7 +43,7 @@ public class ClientTest : BaseFixture [InlineData("http://my.consul.com:5678", "", "http://my.consul.com:5678/")] [InlineData("my.consul.com", "", "http://my.consul.com:8500/")] - [InlineData("https://127.0.0.1:80", "", "https://127.0.0.1/")] + [InlineData("https://127.0.0.1:80", "", "https://127.0.0.1:80/")] [InlineData("https://my.consul.com:5678", "", "https://my.consul.com:5678/")] [InlineData("1.2.3.4:5678", "1", "https://1.2.3.4:5678/")] diff --git a/Consul/Client.cs b/Consul/Client.cs index 2caa5f87..89fa487d 100644 --- a/Consul/Client.cs +++ b/Consul/Client.cs @@ -177,6 +177,7 @@ private void ConfigureFromEnvironment(UriBuilder consulAddress) consulAddress.Port = uri.Port; } consulAddress.Path = uri.AbsolutePath; + consulAddress.Scheme = uri.Scheme; } var useSsl = (Environment.GetEnvironmentVariable("CONSUL_HTTP_SSL") ?? string.Empty).Trim().ToLowerInvariant();