Skip to content

Commit 13ce61d

Browse files
committed
Backport changes that incidentally fix WSClient sending HTTP CONNECT to target host
see https://github.com/marcospereira/async-http-client/commit/d5960563dcbd09854b8ae3e416108ce770b292c2 and #1274
1 parent 4e42edc commit 13ce61d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: client/src/main/java/org/asynchttpclient/netty/handler/AsyncHttpClientHandler.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ public void channelRead(final ChannelHandlerContext ctx, Object msg) throws Exce
6767
Object attribute = Channels.getAttribute(channel);
6868

6969
try {
70-
if (attribute instanceof OnLastHttpContentCallback && msg instanceof LastHttpContent) {
71-
((OnLastHttpContentCallback) attribute).call();
70+
if (attribute instanceof OnLastHttpContentCallback) {
71+
if (msg instanceof LastHttpContent) {
72+
((OnLastHttpContentCallback) attribute).call();
73+
}
7274

7375
} else if (attribute instanceof NettyResponseFuture) {
7476
NettyResponseFuture<?> future = (NettyResponseFuture<?>) attribute;

0 commit comments

Comments
 (0)