Skip to content

Commit cfe1904

Browse files
committed
Add HttpClientInternal#options() internal API for WebClient
1 parent d3d5d7e commit cfe1904

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

vertx-core/src/main/java/io/vertx/core/http/impl/Http1xOrH2ChannelConnector.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ public NetClientInternal netClient() {
8383
return netClient;
8484
}
8585

86+
public HttpClientOptions options() {
87+
return options;
88+
}
89+
8690
private Http2ClientChannelInitializer http2Initializer() {
8791
if (options.getHttp2MultiplexImplementation()) {
8892
return new Http2MultiplexClientChannelInitializer(

vertx-core/src/main/java/io/vertx/core/internal/http/HttpClientInternal.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import io.vertx.core.Closeable;
1515
import io.vertx.core.Future;
1616
import io.vertx.core.http.*;
17+
import io.vertx.core.http.impl.Http1xOrH2ChannelConnector;
1718
import io.vertx.core.http.impl.HttpChannelConnector;
1819
import io.vertx.core.internal.VertxInternal;
1920
import io.vertx.core.internal.net.NetClientInternal;
@@ -35,6 +36,18 @@ public interface HttpClientInternal extends HttpClientAgent, MetricsProvider, Cl
3536

3637
HttpChannelConnector channelConnector();
3738

39+
// Should not be here but currently necessary for WebClient
40+
@Deprecated(forRemoval = true)
41+
default HttpClientOptions options() {
42+
HttpChannelConnector connector = channelConnector();
43+
if (connector instanceof Http1xOrH2ChannelConnector) {
44+
Http1xOrH2ChannelConnector http1xOrH2ChannelConnector = (Http1xOrH2ChannelConnector)connector;
45+
return http1xOrH2ChannelConnector.options();
46+
} else {
47+
return null;
48+
}
49+
}
50+
3851
Future<Void> closeFuture();
3952

4053
}

0 commit comments

Comments
 (0)