Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-6928

Wrong behaviour transferring cacheable content

    XMLWordPrintableJSON

Details

    Description

      Use case:
      Transfer resources from server to the device. To avoid unnecessary use of the device bandwidth, the resources that exists already are checked with the "If-Modified-Since" header so server can return 304 status code and update just in case that is needed.

      Result for Android test:
      The plugin doesn't care about the status code, if the request is success, open the InputStream and copy the content to the file. The problem is that a HTTP status of 304 has no response and that leads to a corrupted file transfer.

      Fix:
      If status code is 304, doesn't makes sense to process the InputStream. Read the status code after connection and if it's 304, skip the copy process and return the file entity like a success transfer.

      I've tested for Android only.

      Attachments

        1. CB-6928.diff
          4 kB
          Javier Puerto

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jpuerto Javier Puerto
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: