diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-03-16 20:32:03 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-03-16 20:32:03 +0100 |
commit | 30be1ad36eac5bb8fc8cfe7fe8d7f5ea54fe13a5 (patch) | |
tree | ed24a1d085bdc272c98ae1622156d57b9593931e /core | |
parent | a92418a525187e8a8aec52de631d52912c86dbee (diff) | |
parent | a8f27fa363d4e0cf9758a64714ffff7c19887c1e (diff) | |
download | AntennaPod-30be1ad36eac5bb8fc8cfe7fe8d7f5ea54fe13a5.zip |
Merge pull request #1701 from mfietz/issue/1627-resume-download
Downloader: Disable gzip for media files
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java index 31775326f..ec84440ec 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java @@ -27,6 +27,7 @@ import java.util.Date; import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.feed.FeedImage; +import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.util.DateUtils; import de.danoeh.antennapod.core.util.DownloadError; import de.danoeh.antennapod.core.util.StorageUtils; @@ -67,6 +68,12 @@ public class HttpDownloader extends Downloader { final URI uri = URIUtil.getURIFromRequestUrl(request.getSource()); Request.Builder httpReq = new Request.Builder().url(uri.toURL()) .header("User-Agent", ClientConfig.USER_AGENT); + if(request.getFeedfileType() == FeedMedia.FEEDFILETYPE_FEEDMEDIA) { + // set header explicitly so that okhttp doesn't do transparent gzip + Log.d(TAG, "addHeader(\"Accept-Encoding\", \"identity\")"); + httpReq.addHeader("Accept-Encoding", "identity"); + } + if(!TextUtils.isEmpty(request.getLastModified())) { String lastModified = request.getLastModified(); Date lastModifiedDate = DateUtils.parse(lastModified); |