diff options
| author | Chris Burdess <dog@bluezoo.org> | 2006-01-20 20:56:02 +0000 |
|---|---|---|
| committer | Chris Burdess <dog@bluezoo.org> | 2006-01-20 20:56:02 +0000 |
| commit | ff6fa66b998ec2a1ed8dcc4a6b50f45246ce3f37 (patch) | |
| tree | a16d82294d10100c65268d22f68e2e6c928c7889 /gnu/java/net/protocol/http/HTTPURLConnection.java | |
| parent | 0bd88a0ce8c6bfe84cf419b6867c3c4e1135213d (diff) | |
| download | classpath-ff6fa66b998ec2a1ed8dcc4a6b50f45246ce3f37.tar.gz | |
2006-01-20 Chris Burdess <dog@gnu.org>
* gnu/java/net/protocol/http/HTTPURLConnection.java: Don't follow
redirects on 304.
Diffstat (limited to 'gnu/java/net/protocol/http/HTTPURLConnection.java')
| -rw-r--r-- | gnu/java/net/protocol/http/HTTPURLConnection.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gnu/java/net/protocol/http/HTTPURLConnection.java b/gnu/java/net/protocol/http/HTTPURLConnection.java index d5da7d61a..f33e70da3 100644 --- a/gnu/java/net/protocol/http/HTTPURLConnection.java +++ b/gnu/java/net/protocol/http/HTTPURLConnection.java @@ -254,7 +254,7 @@ public class HTTPURLConnection } } - if (response.getCodeClass() == 3 && getInstanceFollowRedirects()) + if (isRedirect(response) && getInstanceFollowRedirects()) { // Follow redirect String location = response.getHeader("Location"); @@ -344,6 +344,12 @@ public class HTTPURLConnection 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. */ |
