diff --git a/webclient/webclient/src/main/java/io/helidon/webclient/Proxy.java b/webclient/webclient/src/main/java/io/helidon/webclient/Proxy.java index d1bef260596..704e6017c86 100644 --- a/webclient/webclient/src/main/java/io/helidon/webclient/Proxy.java +++ b/webclient/webclient/src/main/java/io/helidon/webclient/Proxy.java @@ -427,7 +427,7 @@ private Builder() { @Override public Proxy build() { if ((host == null || host.isEmpty()) && systemSelector == null) { - return NO_PROXY; + useSystemSelector(true); } return new Proxy(this); } diff --git a/webclient/webclient/src/test/java/io/helidon/webclient/ProxyTest.java b/webclient/webclient/src/test/java/io/helidon/webclient/ProxyTest.java index 59b690be867..dd40b1806fb 100644 --- a/webclient/webclient/src/test/java/io/helidon/webclient/ProxyTest.java +++ b/webclient/webclient/src/test/java/io/helidon/webclient/ProxyTest.java @@ -166,6 +166,18 @@ void testDefaultProxyType() { assertThat(proxy.type(), is(Proxy.ProxyType.HTTP)); } + @Test + void testDefaultSystem1() { + Proxy proxy = Proxy.create(); + assertThat(proxy.type(), is(Proxy.ProxyType.SYSTEM)); + } + + @Test + void testDefaultSystem2() { + Proxy proxy = Proxy.create(Config.empty()); + assertThat(proxy.type(), is(Proxy.ProxyType.SYSTEM)); + } + private void validateRelativizeNoProxy(WebClientConfiguration webConfig) { boolean relativeUris = webConfig.relativeUris(); Proxy proxy = webConfig.proxy().get();