From 7d80c8fc3909b341bae48234df81224a28f28611 Mon Sep 17 00:00:00 2001 From: Ludovic Orban Date: Wed, 13 May 2020 14:10:10 +0200 Subject: [PATCH] Add constructor to better align with 10.0.x Signed-off-by: Ludovic Orban --- .../java/org/eclipse/jetty/client/HttpClient.java | 14 +++++++++++++- .../websocket/common/test/BlockheadClient.java | 1 - 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java index b181a46a915..545b13cf4b5 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java @@ -163,7 +163,7 @@ public class HttpClient extends ContainerLifeCycle */ public HttpClient() { - this(null); + this(new HttpClientTransportOverHTTP(), null); } /** @@ -178,6 +178,18 @@ public class HttpClient extends ContainerLifeCycle this(new HttpClientTransportOverHTTP(), sslContextFactory); } + /** + * Creates a {@link HttpClient} instance that can perform requests to non-TLS destinations only + * (that is, requests with the "http" scheme only, and not "https"). + * + * @param transport the {@link HttpClientTransport} + * @see #HttpClient(HttpClientTransport, SslContextFactory) to perform requests to TLS destinations. + */ + public HttpClient(HttpClientTransport transport) + { + this(transport, null); + } + public HttpClient(HttpClientTransport transport, SslContextFactory sslContextFactory) { this.transport = transport; diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClient.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClient.java index 22e1a963ab8..d5fc0af0112 100644 --- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClient.java +++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClient.java @@ -44,7 +44,6 @@ public class BlockheadClient extends HttpClient implements WebSocketContainerSco public BlockheadClient() { - super(null); setName("Blockhead-CLIENT"); this.extensionFactory = new WebSocketExtensionFactory(this); }