summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2015-12-04 10:00:32 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-12-04 10:00:32 +0000
commitf0bc25d83ddceccd61c2c11a4fa71b9157290363 (patch)
treea91f25d8f01c2caac84f102b2820d8db2dd3cc48
parentd6de789bd63bc6d2c441c577fb1424309964ad8f (diff)
parent3b37453b1c8a15265640cebf0973ef552e569d33 (diff)
downloadvolley-f0bc25d83ddceccd61c2c11a4fa71b9157290363.tar.gz
Merge "Workaround for HttpURLConnection.getFollowRedirects() on M"
am: 3b37453b1c * commit '3b37453b1c8a15265640cebf0973ef552e569d33': Workaround for HttpURLConnection.getFollowRedirects() on M
-rw-r--r--src/main/java/com/android/volley/toolbox/HurlStack.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/com/android/volley/toolbox/HurlStack.java b/src/main/java/com/android/volley/toolbox/HurlStack.java
index 1be202e..c53d5e0 100644
--- a/src/main/java/com/android/volley/toolbox/HurlStack.java
+++ b/src/main/java/com/android/volley/toolbox/HurlStack.java
@@ -166,7 +166,14 @@ public class HurlStack implements HttpStack {
* Create an {@link HttpURLConnection} for the specified {@code url}.
*/
protected HttpURLConnection createConnection(URL url) throws IOException {
- return (HttpURLConnection) url.openConnection();
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+
+ // Workaround for the M release HttpURLConnection not observing the
+ // HttpURLConnection.setFollowRedirects() property.
+ // https://code.google.com/p/android/issues/detail?id=194495
+ connection.setInstanceFollowRedirects(HttpURLConnection.getFollowRedirects());
+
+ return connection;
}
/**