Skip to content

Commit 2aba2b4

Browse files
author
Stephane Landelle
committed
Merge pull request AsyncHttpClient#332 from korinth/master
Bugfix for JDK API, using proxies
2 parents 252e7bf + 736f257 commit 2aba2b4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

api/src/main/java/org/asynchttpclient/providers/jdk/JDKAsyncHttpProvider.java

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

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

183179
if (request.getUrl().startsWith("https")) {
184180
HttpsURLConnection secure = (HttpsURLConnection) urlConnection;

0 commit comments

Comments
 (0)