summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2015-12-04 09:58:10 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-12-04 09:58:10 +0000
commit3b37453b1c8a15265640cebf0973ef552e569d33 (patch)
treefa12f6baa2d07a709ba126573a9be7866b6c4b31
parent96c4d0b9f58229b9dbba51f1776addedc66f4749 (diff)
parent22205d92f2c31246c19c7d6ded5b75c189fabf87 (diff)
downloadvolley-3b37453b1c8a15265640cebf0973ef552e569d33.tar.gz
Merge "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;
}
/**