We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit b996b868 authored by Mike Sheldon's avatar Mike Sheldon

Support wider range of HTTP redirect cases for froyo work-around

parent eb5579b5
......@@ -199,7 +199,7 @@ public class LibreService extends Service implements OnBufferingUpdateListener,
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setInstanceFollowRedirects(false);
conn.connect();
if(conn.getResponseCode() == 307) {
if(conn.getResponseCode() == 301 || conn.getResponseCode() == 302 || conn.getResponseCode() == 307) {
Log.d("libredroid", "Got a HTTP redirection for " + url.toString() + ". Resolves to: " + conn.getHeaderField("Location") + " (resolving it ourselves to avoid Froyo's incomplete HTTP streaming implementation)");
this.mp.setDataSource(conn.getHeaderField("Location"));
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment