Skip to content

Commit 6e9a62b

Browse files
author
oleksiys
committed
[1.9.x] + change the URI logic to look more like in Netty provider
1 parent 390e2fe commit 6e9a62b

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

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

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,9 @@ private static class NTLM_INSTANCE_HOLDER {
7070
private static final HeaderValue CLOSE_VALUE = HeaderValue.newHeaderValue("close");
7171

7272
private final AsyncHttpClientConfig config;
73-
private final GrizzlyAsyncHttpProvider provider;
7473

7574
// -------------------------------------------------------- Constructors
7675
AsyncHttpClientFilter(final GrizzlyAsyncHttpProvider provider) {
77-
this.provider = provider;
7876
this.config = provider.getClientConfig();
7977
}
8078

@@ -124,22 +122,15 @@ private boolean sendAsGrizzlyRequest(final HttpTransactionContext httpTxCtx, fin
124122
return establishConnectTunnel(proxy, httpTxCtx, uri, ctx);
125123
}
126124
final HttpRequestPacket.Builder builder = HttpRequestPacket.builder().protocol(Protocol.HTTP_1_1).method(method);
127-
if (useProxy) {
128-
if (secure || httpTxCtx.isWSRequest) {
129-
// Sending message over established CONNECT tunnel
130-
if (config.isUseRelativeURIsWithConnectProxies()) {
131-
builder.uri(AsyncHttpProviderUtils.getNonEmptyPath(uri));
132-
builder.query(uri.getQuery());
133-
} else {
134-
builder.uri(uri.toUrl());
135-
}
136-
} else {
137-
builder.uri(uri.toUrl());
138-
}
125+
126+
if (useProxy && !((secure || httpTxCtx.isWSRequest) &&
127+
config.isUseRelativeURIsWithConnectProxies())) {
128+
builder.uri(uri.toUrl());
139129
} else {
140130
builder.uri(AsyncHttpProviderUtils.getNonEmptyPath(uri));
141131
builder.query(uri.getQuery());
142132
}
133+
143134
HttpRequestPacket requestPacket;
144135
final PayloadGenerator payloadGenerator = isPayloadAllowed(method) ? PayloadGenFactory.getPayloadGenerator(ahcRequest) : null;
145136
if (payloadGenerator != null) {

0 commit comments

Comments
 (0)