7150539: HttpURLConnection.getResponseMessage() doesn't throw IOException on server error (OS X)

Reviewed-by: michaelm, alanb
This commit is contained in:
Chris Hegarty 2014-01-31 11:10:36 +00:00
parent e3f4248c42
commit 49605b7bf9

View File

@ -55,8 +55,8 @@ public class RetryPost
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();