Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5044B187BD for ; Wed, 11 Nov 2015 14:10:11 +0000 (UTC) Received: (qmail 42045 invoked by uid 500); 11 Nov 2015 14:10:11 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 42022 invoked by uid 500); 11 Nov 2015 14:10:11 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 42011 invoked by uid 99); 11 Nov 2015 14:10:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Nov 2015 14:10:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id F34BB2C1F5B for ; Wed, 11 Nov 2015 14:10:10 +0000 (UTC) Date: Wed, 11 Nov 2015 14:10:10 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-7006) [cordova-plugin-file-transfer] Empty file is created on file transfer if server response is 304. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-7006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15000406#comment-15000406 ] ASF GitHub Bot commented on CB-7006: ------------------------------------ GitHub user daserge opened a pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/113 CB-7006 Empty file is created on file transfer if server response is 304 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](https://issues.apache.org/jira/browse/CB-7006) You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-plugin-file-transfer CB-7006 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-file-transfer/pull/113.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #113 ---- commit a85d54da8db9b52bc55160b933640b05383464e1 Author: daserge Date: 2015-11-11T11:06:23Z CB-7006 Empty file is created on file transfer if server response is 304 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 in case of a download error. ---- > [cordova-plugin-file-transfer] Empty file is created on file transfer if server response is 304. > ------------------------------------------------------------------------------------------------ > > Key: CB-7006 > URL: https://issues.apache.org/jira/browse/CB-7006 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File Transfer > Environment: Android 4.3, cordova 3.4.1, plugin-file-transfer r0.4.4 > Reporter: Romain Garrigues > > Hi, > I want to use file transfer plugin with "If-Modified-Since" HTTP header. > When receiving 304 status code from server (file not changed), It seems that file transfer plugin overwrites the current file on device by... new empty one. > As plugin does not verify HTTP response status code, and HTTP 304 response contains an empty body content, maybe that's a point to check to avoid overwriting already present data ? -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org