Skip to content

Commit 736f257

Browse files
author
Martin Korinth
committed
Fixed a bug using proxies with the JDK API, found by DanielAdolfsson
1 parent 252e7bf commit 736f257

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)