apache / cordova-plugin-file-transfer

Apache Cordova File Transfer Plugin
https://cordova.apache.org/
Apache License 2.0
597 stars 886 forks source link

CB-7006 Empty file is created on file transfer if server response is 304 #113

Closed daserge closed 8 years ago

daserge commented 8 years ago

Adds a corresponding test. Fixes the Windows proxy to not to delete the file in case of 304. As a side effect the new code will not delete a cached file (previously downloaded f.e.) in case of a download error.

The test is passing on Android and Windows (with this modification) and fails on iOS as code 200 comes for the second request disregarding the If-Modified-Since header, as soon as we get code 200 in the first request (the file is being cached by the iOS proxy somewhere).

@shazron, could you please point to where to look at in the iOS implementation for this caching?

Jira issue

daserge commented 8 years ago

Added a workaround for iOS using query parameters. The similar iOS issue is described in CB-8606 File-Transfer with Range-Header is cached on iOS.