From 407a8e0870ee015acbc92dc03290ec171e502ae3 Mon Sep 17 00:00:00 2001 From: Keith Lustria Date: Tue, 22 Aug 2023 23:27:24 -0700 Subject: [PATCH 1/2] Include Proxy setting as part of deciding relativeURIs logic Description: This is a feature parity change with prior versions related to relativeUris config logic. When proxy is set or host is in no-proxy list, the request uses absolute URI because of Section 5.1.2 Request-URI spec in https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html which states: "The absoluteURI form is REQUIRED when the request is being made to a proxy.". If absoluteURI does not work as the request URI, then relativeUris config can be set to true to override this behavior. Documentation impact: When relativeUris is documented as a webclient config, we can add the notes mentioned in the Description above. Additional notes: This change can be compared to this code section in 3.x that performs the same logic: https://github.com/helidon-io/helidon/blob/helidon-3.x/webclient/webclient/src/main/java/io/helidon/webclient/WebClientRequestBuilderImpl.java#L756-L763 --- .../api/HttpClientConfigBlueprint.java | 3 +- .../api/HttpClientConfigSupport.java | 3 +- .../java/io/helidon/webclient/api/Proxy.java | 2 +- .../webclient/http1/Http1CallChainBase.java | 9 +- .../webclient/http1/Http1ClientTest.java | 104 +++++++++++++----- 5 files changed, 91 insertions(+), 30 deletions(-) diff --git a/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigBlueprint.java b/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigBlueprint.java index 8a596c1797c..7cfff160033 100644 --- a/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigBlueprint.java +++ b/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigBlueprint.java @@ -179,8 +179,7 @@ default ClientRequestHeaders defaultRequestHeaders() { * * @return relative URIs flag */ - // TODO Set the default value to false when proxy is implemented and see Http1CallChainBase.prologue for other changes - @ConfiguredOption("true") + @ConfiguredOption("false") boolean relativeUris(); /** diff --git a/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigSupport.java b/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigSupport.java index 97ed8cd579c..f4874a4bd75 100644 --- a/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigSupport.java +++ b/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigSupport.java @@ -188,7 +188,8 @@ public void decorate(HttpClientConfig.BuilderBase target) { } if (target.proxy().isEmpty()) { - target.proxy(Proxy.create()); + // Defaults to NoProxy type if Proxy is not set + target.proxy(Proxy.noProxy()); } } } diff --git a/webclient/api/src/main/java/io/helidon/webclient/api/Proxy.java b/webclient/api/src/main/java/io/helidon/webclient/api/Proxy.java index 84af190e638..60b958d0855 100644 --- a/webclient/api/src/main/java/io/helidon/webclient/api/Proxy.java +++ b/webclient/api/src/main/java/io/helidon/webclient/api/Proxy.java @@ -294,7 +294,7 @@ public ProxyType type() { * @param uri the uri * @return true if it is in no hosts, otherwise false */ - private boolean isNoHosts(InetSocketAddress uri) { + public boolean isNoHosts(InetSocketAddress uri) { return noProxy.apply(uri); } diff --git a/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1CallChainBase.java b/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1CallChainBase.java index 6919749a9ac..6c069e75d0d 100644 --- a/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1CallChainBase.java +++ b/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1CallChainBase.java @@ -18,6 +18,7 @@ import java.io.InputStream; import java.io.UncheckedIOException; +import java.net.InetSocketAddress; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.concurrent.CompletableFuture; @@ -157,7 +158,13 @@ void prologue(BufferData nonEntityData, WebClientServiceRequest request, ClientU + request.headers().get(Http.HeaderNames.HOST).value() + " HTTP/1.1\r\n"); } else { - String schemeHostPort = clientConfig.relativeUris() ? "" : uri.scheme() + "://" + uri.host() + ":" + uri.port(); + // When proxy is set, ensure that the request uses absolute URI because of Section 5.1.2 Request-URI in + // https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html which states: "The absoluteURI form is REQUIRED when the + // request is being made to a proxy." + InetSocketAddress uriAddress = new InetSocketAddress(uri.host(), uri.port()); + String schemeHostPort = proxy == Proxy.noProxy() || proxy.isNoHosts(uriAddress) || clientConfig.relativeUris() + ? "" // relative URI + : uri.scheme() + "://" + uri.host() + ":" + uri.port(); // absolute URI nonEntityData.writeAscii(request.method().text() + " " + schemeHostPort diff --git a/webclient/http1/src/test/java/io/helidon/webclient/http1/Http1ClientTest.java b/webclient/http1/src/test/java/io/helidon/webclient/http1/Http1ClientTest.java index 1f64a68b463..eb2cafe1e8b 100644 --- a/webclient/http1/src/test/java/io/helidon/webclient/http1/Http1ClientTest.java +++ b/webclient/http1/src/test/java/io/helidon/webclient/http1/Http1ClientTest.java @@ -48,6 +48,7 @@ import io.helidon.logging.common.LogConfig; import io.helidon.webclient.api.ClientConnection; import io.helidon.webclient.api.HttpClientResponse; +import io.helidon.webclient.api.Proxy; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -78,6 +79,9 @@ class Http1ClientTest { .sendExpectContinue(false) .build(); private static final int dummyPort = 1234; + private enum RelativeUrisValue { + TRUE, FALSE, DEFAULT; + } @Test void testMaxHeaderSizeFail() { @@ -218,17 +222,19 @@ void testSkipUrlEncoding() { @ParameterizedTest @MethodSource("relativeUris") - void testRelativeUris(boolean relativeUris, boolean outputStream, String requestUri, String expectedUriStart) { - Http1Client client = Http1Client.builder().relativeUris(relativeUris).build(); + void testRelativeUris(Proxy proxy, RelativeUrisValue relativeUris, boolean outputStream, String requestUri, String expectedUriStart) { + Http1Client client; + switch (relativeUris) { + case TRUE -> client = Http1Client.builder().relativeUris(true).build(); + case FALSE -> client = Http1Client.builder().relativeUris(false).build(); + default -> client = Http1Client.create(); // Don't set relativeUris and accept whatever is the default + } FakeHttp1ClientConnection connection = new FakeHttp1ClientConnection(); - Http1ClientRequest request = client.put(requestUri); + Http1ClientRequest request = proxy != null ? client.put(requestUri).proxy(proxy) : client.put(requestUri); request.connection(connection); - HttpClientResponse response; - if (outputStream) { - response = getHttp1ClientResponseFromOutputStream(request, new String[] {"Sending Something"}); - } else { - response = request.submit("Sending Something"); - } + HttpClientResponse response = outputStream + ? getHttp1ClientResponseFromOutputStream(request, new String[] {"Sending Something"}) + : request.submit("Sending Something"); assertThat(response.status(), is(Http.Status.OK_200)); StringTokenizer st = new StringTokenizer(connection.getPrologue(), " "); @@ -393,25 +399,73 @@ private static Http1ClientResponse getHttp1ClientResponseFromOutputStream(Http1C } private static Stream relativeUris() { + String host = "www.oracle.com"; + String path = "/test"; + Proxy.Builder httpProxyroxyBuilder = Proxy.builder() + .type(Proxy.ProxyType.HTTP) + .host("proxyhost") + .port(80); + // Request type + boolean isOutputStream = true; + boolean isEntity = !isOutputStream; + // Proxy configuration + Proxy proxyEmptyNoProxyList = httpProxyroxyBuilder.build(); + Proxy proxyWithNoProxyHost = httpProxyroxyBuilder.addNoProxy(host).build(); + Proxy proxyNoProxy = Proxy.noProxy(); + Proxy proxyNotSet = null; + return Stream.of( // OutputStream (chunk request) - arguments(false, true, "http://www.dummy.com/test", "http://www.dummy.com:80/"), - arguments(false, true, "http://www.dummy.com:1111/test", "http://www.dummy.com:1111/"), - arguments(false, true, "https://www.dummy.com/test", "https://www.dummy.com:443/"), - arguments(false, true, "https://www.dummy.com:1111/test", "https://www.dummy.com:1111/"), - arguments(true, true, "http://www.dummy.com/test", "/test"), - arguments(true, true, "http://www.dummy.com:1111/test", "/test"), - arguments(true, true, "https://www.dummy.com/test", "/test"), - arguments(true, true, "https://www.dummy.com:1111/test", "/test"), + // Expects absolute URI + arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isOutputStream, + "http://" + host + path, "http://" + host + ":80/"), + arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isOutputStream, + "https://" + host + path, "https://" + host + ":443/"), + arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isOutputStream, + "http://" + host + ":1111/test", path), + arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isOutputStream, + "http://" + host + ":1111/test", "http://" + host + ":1111/"), + arguments(proxyEmptyNoProxyList, RelativeUrisValue.DEFAULT, isOutputStream, + "http://" + host + path, "http://" + host + ":80/"), + // Expects relative URI + arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isOutputStream, + "http://" + host + path, path), + arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isOutputStream, + "https://" + host + path, path), + arguments(proxyWithNoProxyHost, RelativeUrisValue.DEFAULT, isOutputStream, + "http://" + host + path, path), + arguments(proxyNoProxy, RelativeUrisValue.DEFAULT, isOutputStream, + "http://" + host + path, path), + arguments(proxyNoProxy, RelativeUrisValue.FALSE, isOutputStream, + "http://" + host + path, path), + arguments(proxyNotSet, RelativeUrisValue.DEFAULT, isOutputStream, + "http://" + host + path, path), // non-OutputStream (single entity request) - arguments(false, false, "http://www.dummy.com/test", "http://www.dummy.com:80/"), - arguments(false, false, "http://www.dummy.com:1111/test", "http://www.dummy.com:1111/"), - arguments(false, false, "https://www.dummy.com/test", "https://www.dummy.com:443/"), - arguments(false, false, "https://www.dummy.com:1111/test", "https://www.dummy.com:1111/"), - arguments(true, false, "http://www.dummy.com/test", "/test"), - arguments(true, false, "http://www.dummy.com:1111/test", "/test"), - arguments(true, false, "https://www.dummy.com/test", "/test"), - arguments(true, false, "https://www.dummy.com:1111/test", "/test")); + // Expects absolute URI + arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isEntity, + "http://" + host + path, "http://" + host + ":80/"), + arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isEntity, + "https://" + host + path, "https://" + host + ":443/"), + arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isEntity, + "http://" + host + ":1111/test", path), + arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isEntity, + "http://" + host + ":1111/test", "http://" + host + ":1111/"), + arguments(proxyEmptyNoProxyList, RelativeUrisValue.DEFAULT, isEntity, + "http://" + host + path, "http://" + host + ":80/"), + // Expects relative URI + arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isEntity, + "http://" + host + path, path), + arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isEntity, + "https://" + host + path, path), + arguments(proxyWithNoProxyHost, RelativeUrisValue.DEFAULT, isEntity, + "http://" + host + path, path), + arguments(proxyNoProxy, RelativeUrisValue.DEFAULT, isEntity, + "http://" + host + path, path), + arguments(proxyNoProxy, RelativeUrisValue.FALSE, isEntity, + "http://" + host + path, path), + arguments(proxyNotSet, RelativeUrisValue.DEFAULT, isEntity, + "http://" + host + path, path) + ); } private static Stream headerValues() { From c579f0d250c480e8307f90d8ce8bd03919618db9 Mon Sep 17 00:00:00 2001 From: Keith Lustria Date: Wed, 23 Aug 2023 21:27:41 -0700 Subject: [PATCH 2/2] Add System Proxy setting in deciding relativeURIs logic --- .../api/HttpClientConfigSupport.java | 3 +- .../java/io/helidon/webclient/api/Proxy.java | 15 ++ .../webclient/http1/Http1CallChainBase.java | 12 +- .../webclient/http1/Http1ClientTest.java | 163 ++++++++++++------ 4 files changed, 130 insertions(+), 63 deletions(-) diff --git a/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigSupport.java b/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigSupport.java index f4874a4bd75..97ed8cd579c 100644 --- a/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigSupport.java +++ b/webclient/api/src/main/java/io/helidon/webclient/api/HttpClientConfigSupport.java @@ -188,8 +188,7 @@ public void decorate(HttpClientConfig.BuilderBase target) { } if (target.proxy().isEmpty()) { - // Defaults to NoProxy type if Proxy is not set - target.proxy(Proxy.noProxy()); + target.proxy(Proxy.create()); } } } diff --git a/webclient/api/src/main/java/io/helidon/webclient/api/Proxy.java b/webclient/api/src/main/java/io/helidon/webclient/api/Proxy.java index 60b958d0855..a178a803e3f 100644 --- a/webclient/api/src/main/java/io/helidon/webclient/api/Proxy.java +++ b/webclient/api/src/main/java/io/helidon/webclient/api/Proxy.java @@ -298,6 +298,21 @@ public boolean isNoHosts(InetSocketAddress uri) { return noProxy.apply(uri); } + /** + * Verifies whether the specified Uri is using system proxy. + * + * @param uri the uri + * @return true if the uri resource will be proxied + */ + public boolean isUsingSystemProxy(String uri) { + if (systemProxySelector != null) { + List proxies = systemProxySelector + .select(URI.create(uri)); + return !proxies.isEmpty() && !proxies.get(0).equals(java.net.Proxy.NO_PROXY); + } + return false; + } + /** * Creates an Optional with the InetSocketAddress of the server proxy for the specified uri. * diff --git a/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1CallChainBase.java b/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1CallChainBase.java index 6c069e75d0d..0296b8fa12f 100644 --- a/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1CallChainBase.java +++ b/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1CallChainBase.java @@ -161,13 +161,17 @@ void prologue(BufferData nonEntityData, WebClientServiceRequest request, ClientU // When proxy is set, ensure that the request uses absolute URI because of Section 5.1.2 Request-URI in // https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html which states: "The absoluteURI form is REQUIRED when the // request is being made to a proxy." + String absoluteUri = uri.scheme() + "://" + uri.host() + ":" + uri.port(); InetSocketAddress uriAddress = new InetSocketAddress(uri.host(), uri.port()); - String schemeHostPort = proxy == Proxy.noProxy() || proxy.isNoHosts(uriAddress) || clientConfig.relativeUris() - ? "" // relative URI - : uri.scheme() + "://" + uri.host() + ":" + uri.port(); // absolute URI + String requestUri = proxy == Proxy.noProxy() + || (proxy.type() == Proxy.ProxyType.HTTP && proxy.isNoHosts(uriAddress)) + || (proxy.type() == Proxy.ProxyType.SYSTEM && !proxy.isUsingSystemProxy(absoluteUri)) + || clientConfig.relativeUris() + ? "" // don't set host details, so it becomes relative URI + : absoluteUri; nonEntityData.writeAscii(request.method().text() + " " - + schemeHostPort + + requestUri + uri.pathWithQueryAndFragment() + " HTTP/1.1\r\n"); } diff --git a/webclient/http1/src/test/java/io/helidon/webclient/http1/Http1ClientTest.java b/webclient/http1/src/test/java/io/helidon/webclient/http1/Http1ClientTest.java index eb2cafe1e8b..7f7df7d39c7 100644 --- a/webclient/http1/src/test/java/io/helidon/webclient/http1/Http1ClientTest.java +++ b/webclient/http1/src/test/java/io/helidon/webclient/http1/Http1ClientTest.java @@ -79,8 +79,16 @@ class Http1ClientTest { .sendExpectContinue(false) .build(); private static final int dummyPort = 1234; + private static final String TARGET_HOST = "www.oracle.com"; + private static final String TARGET_URI_PATH = "/test"; + public static final String PROXY_HOST = "http://www-proxy-hqdc.us.oracle.com"; + public static final String PROXY_PORT = "80"; + private enum RelativeUrisValue { - TRUE, FALSE, DEFAULT; + TRUE, FALSE, DEFAULT + } + private enum ProxyConfiguration { + UNSET, NO_PROXY, HTTP, HTTP_SET_NO_PROXY_HOST, SYSTEM_UNSET, SYSTEM_SET_PROXY, SYSTEM_SET_PROXY_AND_NON_PROXY_HOST } @Test @@ -222,7 +230,27 @@ void testSkipUrlEncoding() { @ParameterizedTest @MethodSource("relativeUris") - void testRelativeUris(Proxy proxy, RelativeUrisValue relativeUris, boolean outputStream, String requestUri, String expectedUriStart) { + void testRelativeUris(ProxyConfiguration proxyConfig, RelativeUrisValue relativeUris, boolean outputStream, String requestUri, String expectedUriStart) { + Proxy proxy = null; + switch (proxyConfig) { + case UNSET -> {} // proxy is already initialized to null which is the goal of this condition, so no-op + case NO_PROXY -> proxy = Proxy.noProxy(); + case HTTP -> proxy = createHttpProxyBuilder().build(); + case HTTP_SET_NO_PROXY_HOST -> proxy = createHttpProxyBuilder().addNoProxy(TARGET_HOST).build(); + case SYSTEM_UNSET -> proxy = Proxy.create(); + case SYSTEM_SET_PROXY -> { + proxy = Proxy.create(); + System.setProperty("http.proxyHost", PROXY_HOST); + System.setProperty("http.proxyPort", PROXY_PORT); + } + case SYSTEM_SET_PROXY_AND_NON_PROXY_HOST -> { + proxy = Proxy.create(); + System.setProperty("http.proxyHost", PROXY_HOST); + System.setProperty("http.proxyPort", PROXY_PORT); + System.setProperty("http.nonProxyHosts", "localhost|127.0.0.1|10.*.*.*|*.example.com|etc|" + TARGET_HOST); + } + } + Http1Client client; switch (relativeUris) { case TRUE -> client = Http1Client.builder().relativeUris(true).build(); @@ -242,6 +270,19 @@ void testRelativeUris(Proxy proxy, RelativeUrisValue relativeUris, boolean outpu st.nextToken(); // Validate URI part assertThat(st.nextToken(), startsWith(expectedUriStart)); + + // Clear proxy system properties that were set + switch (proxyConfig) { + case SYSTEM_SET_PROXY -> { + System.clearProperty("http.proxyHost"); + System.clearProperty("http.proxyPort"); + } + case SYSTEM_SET_PROXY_AND_NON_PROXY_HOST -> { + System.clearProperty("http.proxyHost"); + System.clearProperty("http.proxyPort"); + System.clearProperty("http.nonProxyHosts"); + } + } } @ParameterizedTest @@ -398,73 +439,81 @@ private static Http1ClientResponse getHttp1ClientResponseFromOutputStream(Http1C return response; } - private static Stream relativeUris() { - String host = "www.oracle.com"; - String path = "/test"; - Proxy.Builder httpProxyroxyBuilder = Proxy.builder() + private static Proxy.Builder createHttpProxyBuilder() { + return Proxy.builder() .type(Proxy.ProxyType.HTTP) - .host("proxyhost") - .port(80); + .host(PROXY_HOST) + .port(Integer.parseInt(PROXY_PORT)); + } + + private static Stream relativeUris() { // Request type boolean isOutputStream = true; boolean isEntity = !isOutputStream; - // Proxy configuration - Proxy proxyEmptyNoProxyList = httpProxyroxyBuilder.build(); - Proxy proxyWithNoProxyHost = httpProxyroxyBuilder.addNoProxy(host).build(); - Proxy proxyNoProxy = Proxy.noProxy(); - Proxy proxyNotSet = null; return Stream.of( // OutputStream (chunk request) // Expects absolute URI - arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isOutputStream, - "http://" + host + path, "http://" + host + ":80/"), - arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isOutputStream, - "https://" + host + path, "https://" + host + ":443/"), - arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isOutputStream, - "http://" + host + ":1111/test", path), - arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isOutputStream, - "http://" + host + ":1111/test", "http://" + host + ":1111/"), - arguments(proxyEmptyNoProxyList, RelativeUrisValue.DEFAULT, isOutputStream, - "http://" + host + path, "http://" + host + ":80/"), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.FALSE, isOutputStream, + "http://" + TARGET_HOST + TARGET_URI_PATH, "http://" + TARGET_HOST + ":80/"), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.FALSE, isOutputStream, + "https://" + TARGET_HOST + TARGET_URI_PATH, "https://" + TARGET_HOST + ":443/"), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.TRUE, isOutputStream, + "http://" + TARGET_HOST + ":1111/test", TARGET_URI_PATH), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.FALSE, isOutputStream, + "http://" + TARGET_HOST + ":1111/test", "http://" + TARGET_HOST + ":1111/"), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.DEFAULT, isOutputStream, + "http://" + TARGET_HOST + TARGET_URI_PATH, "http://" + TARGET_HOST + ":80/"), + arguments(ProxyConfiguration.SYSTEM_SET_PROXY, RelativeUrisValue.FALSE, isOutputStream, + "http://" + TARGET_HOST + TARGET_URI_PATH, "http://" + TARGET_HOST + ":80/"), // Expects relative URI - arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isOutputStream, - "http://" + host + path, path), - arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isOutputStream, - "https://" + host + path, path), - arguments(proxyWithNoProxyHost, RelativeUrisValue.DEFAULT, isOutputStream, - "http://" + host + path, path), - arguments(proxyNoProxy, RelativeUrisValue.DEFAULT, isOutputStream, - "http://" + host + path, path), - arguments(proxyNoProxy, RelativeUrisValue.FALSE, isOutputStream, - "http://" + host + path, path), - arguments(proxyNotSet, RelativeUrisValue.DEFAULT, isOutputStream, - "http://" + host + path, path), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.TRUE, isOutputStream, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.TRUE, isOutputStream, + "https://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.HTTP_SET_NO_PROXY_HOST, RelativeUrisValue.DEFAULT, isOutputStream, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.NO_PROXY, RelativeUrisValue.DEFAULT, isOutputStream, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.NO_PROXY, RelativeUrisValue.FALSE, isOutputStream, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.NO_PROXY, RelativeUrisValue.DEFAULT, isOutputStream, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.SYSTEM_UNSET, RelativeUrisValue.FALSE, isOutputStream, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.SYSTEM_SET_PROXY_AND_NON_PROXY_HOST, RelativeUrisValue.FALSE, isOutputStream, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), // non-OutputStream (single entity request) // Expects absolute URI - arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isEntity, - "http://" + host + path, "http://" + host + ":80/"), - arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isEntity, - "https://" + host + path, "https://" + host + ":443/"), - arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isEntity, - "http://" + host + ":1111/test", path), - arguments(proxyEmptyNoProxyList, RelativeUrisValue.FALSE, isEntity, - "http://" + host + ":1111/test", "http://" + host + ":1111/"), - arguments(proxyEmptyNoProxyList, RelativeUrisValue.DEFAULT, isEntity, - "http://" + host + path, "http://" + host + ":80/"), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.FALSE, isEntity, + "http://" + TARGET_HOST + TARGET_URI_PATH, "http://" + TARGET_HOST + ":80/"), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.FALSE, isEntity, + "https://" + TARGET_HOST + TARGET_URI_PATH, "https://" + TARGET_HOST + ":443/"), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.TRUE, isEntity, + "http://" + TARGET_HOST + ":1111/test", TARGET_URI_PATH), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.FALSE, isEntity, + "http://" + TARGET_HOST + ":1111/test", "http://" + TARGET_HOST + ":1111/"), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.DEFAULT, isEntity, + "http://" + TARGET_HOST + TARGET_URI_PATH, "http://" + TARGET_HOST + ":80/"), + arguments(ProxyConfiguration.SYSTEM_SET_PROXY, RelativeUrisValue.FALSE, isEntity, + "http://" + TARGET_HOST + TARGET_URI_PATH, "http://" + TARGET_HOST + ":80/"), // Expects relative URI - arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isEntity, - "http://" + host + path, path), - arguments(proxyEmptyNoProxyList, RelativeUrisValue.TRUE, isEntity, - "https://" + host + path, path), - arguments(proxyWithNoProxyHost, RelativeUrisValue.DEFAULT, isEntity, - "http://" + host + path, path), - arguments(proxyNoProxy, RelativeUrisValue.DEFAULT, isEntity, - "http://" + host + path, path), - arguments(proxyNoProxy, RelativeUrisValue.FALSE, isEntity, - "http://" + host + path, path), - arguments(proxyNotSet, RelativeUrisValue.DEFAULT, isEntity, - "http://" + host + path, path) + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.TRUE, isEntity, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.HTTP, RelativeUrisValue.TRUE, isEntity, + "https://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.HTTP_SET_NO_PROXY_HOST, RelativeUrisValue.DEFAULT, isEntity, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.NO_PROXY, RelativeUrisValue.DEFAULT, isEntity, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.NO_PROXY, RelativeUrisValue.FALSE, isEntity, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.NO_PROXY, RelativeUrisValue.DEFAULT, isEntity, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.SYSTEM_UNSET, RelativeUrisValue.FALSE, isEntity, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH), + arguments(ProxyConfiguration.SYSTEM_SET_PROXY_AND_NON_PROXY_HOST, RelativeUrisValue.FALSE, isEntity, + "http://" + TARGET_HOST + TARGET_URI_PATH, TARGET_URI_PATH) ); }