Index: gnu/java/net/protocol/http/HTTPURLConnection.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java,v retrieving revision 1.15 diff -u -r1.15 HTTPURLConnection.java --- gnu/java/net/protocol/http/HTTPURLConnection.java 12 Oct 2005 19:48:25 -0000 1.15 +++ gnu/java/net/protocol/http/HTTPURLConnection.java 20 Jan 2006 20:54:51 -0000 @@ -254,7 +254,7 @@ } } - if (response.getCodeClass() == 3 && getInstanceFollowRedirects()) + if (isRedirect(response) && getInstanceFollowRedirects()) { // Follow redirect String location = response.getHeader("Location"); @@ -344,6 +344,12 @@ connected = true; } + private static boolean isRedirect(Response response) + { + int sc = response.getCode(); + return (sc != 304 && (sc / 100) == 3); + } + /** * Returns a connection, from the pool if necessary. */