7150539: HttpURLConnection.getResponseMessage() doesn't throw IOException on server error (OS X)
authorchegar
Fri, 31 Jan 2014 11:10:36 +0000
changeset 22625 50ee5cbd439b
parent 22624 860bde7fa0eb
child 22626 758d413359c4
7150539: HttpURLConnection.getResponseMessage() doesn't throw IOException on server error (OS X) Reviewed-by: michaelm, alanb
jdk/test/sun/net/www/http/HttpClient/RetryPost.java
--- a/jdk/test/sun/net/www/http/HttpClient/RetryPost.java	Fri Jan 31 12:06:34 2014 +0100
+++ b/jdk/test/sun/net/www/http/HttpClient/RetryPost.java	Fri Jan 31 11:10:36 2014 +0000
@@ -55,8 +55,8 @@
     void doClient() {
         try {
             InetSocketAddress address = httpServer.getAddress();
-            URL url = new URL("http://" + address.getHostName() + ":" + address.getPort() + "/test/");
-            HttpURLConnection uc = (HttpURLConnection)url.openConnection();
+            URL url = new URL("http://localhost:" + address.getPort() + "/test/");
+            HttpURLConnection uc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
             uc.setDoOutput(true);
             uc.setRequestMethod("POST");
             uc.getResponseCode();