Skip to content

Commit 377fb56

Browse files
author
Stephane Landelle
committed
Merge pull request AsyncHttpClient#333 from korinth/ahc-1.7.x
Fixed a bug using proxies with the JDK API, found by DanielAdolfsson
2 parents a5515b5 + 48a65d4 commit 377fb56

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/main/java/com/ning/http/client/providers/jdk/JDKAsyncHttpProvider.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,8 @@ private HttpURLConnection createUrlConnection(Request request) throws IOExceptio
175175
}
176176
}
177177

178-
HttpURLConnection urlConnection = null;
179-
if (proxy == null) {
180-
urlConnection = (HttpURLConnection) request.getURI().toURL().openConnection(Proxy.NO_PROXY);
181-
} else {
182-
urlConnection = (HttpURLConnection) proxyServer.getURI().toURL().openConnection(proxy);
183-
}
178+
HttpURLConnection urlConnection = (HttpURLConnection)
179+
request.getURI().toURL().openConnection(proxy == null ? Proxy.NO_PROXY : proxy);
184180

185181
if (request.getUrl().startsWith("https")) {
186182
HttpsURLConnection secure = (HttpsURLConnection) urlConnection;

0 commit comments

Comments
 (0)