From 291cd987e222e6bcca7a80e46f81942ced3af444 Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 11 Jun 2017 17:15:15 +0800 Subject: [PATCH] fix a bug : the redirect code in HttpUrlSource is not working, because it never get a chance to be run --- library/src/main/java/com/danikula/videocache/HttpUrlSource.java | 1 + 1 file changed, 1 insertion(+) diff --git a/library/src/main/java/com/danikula/videocache/HttpUrlSource.java b/library/src/main/java/com/danikula/videocache/HttpUrlSource.java index c7fb8ad..f875cdf 100644 --- a/library/src/main/java/com/danikula/videocache/HttpUrlSource.java +++ b/library/src/main/java/com/danikula/videocache/HttpUrlSource.java @@ -160,6 +160,7 @@ private HttpURLConnection openConnection(long offset, int timeout) throws IOExce do { LOG.debug("Open connection " + (offset > 0 ? " with offset " + offset : "") + " to " + url); connection = (HttpURLConnection) new URL(url).openConnection(); + connection.setInstanceFollowRedirects(false); injectCustomHeaders(connection, url); if (offset > 0) { connection.setRequestProperty("Range", "bytes=" + offset + "-");