Skip to content

Commit 765d400

Browse files
author
oleksiys
committed
[1.8.x] + fix issue AsyncHttpClient#637
AsyncHttpClient#637 "AHC with Grizzly provider not handling SSL Connect/tunnelling with Proxy"
1 parent 3cb7951 commit 765d400

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/main/java/com/ning/http/client/providers/grizzly/GrizzlyAsyncHttpProvider.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,22 @@ protected void onHttpHeadersParsed(HttpHeader httpHeader,
14771477

14781478
}
14791479

1480-
1480+
@Override
1481+
protected boolean onHttpHeaderParsed(final HttpHeader httpHeader,
1482+
final Buffer buffer, final FilterChainContext ctx) {
1483+
super.onHttpHeaderParsed(httpHeader, buffer, ctx);
1484+
1485+
final HttpRequestPacket request = ((HttpResponsePacket) httpHeader).getRequest();
1486+
if (Method.CONNECT.equals(request.getMethod())) {
1487+
// finish request/response processing, because Grizzly itself
1488+
// treats CONNECT traffic as part of request-response processing
1489+
// and we don't want it be treated like that
1490+
httpHeader.setExpectContent(false);
1491+
}
1492+
1493+
return false;
1494+
}
1495+
14811496
@SuppressWarnings({"unchecked"})
14821497
@Override
14831498
protected boolean onHttpPacketParsed(HttpHeader httpHeader, FilterChainContext ctx) {

0 commit comments

Comments
 (0)