cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Grieve (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-2183) [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse
Date Fri, 11 Jan 2013 02:11:11 GMT

    [ https://issues.apache.org/jira/browse/CB-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13550699#comment-13550699
] 

Andrew Grieve commented on CB-2183:
-----------------------------------

I think Patrick's patch means to address the same issue that's surfacing here.

V1 of the code - Assumes response is NSHTTPURLResponse
V2 of the code (Patrick's patch) - Check if it's not an NSHTTPURLResponse, and if not, return
an error

What we want to do in this case is to continue to check if it's not a NSHTTPURLResponse, and
if not and it's a file:///, then use NSFileManager to figure out bytesExpected and set the
response to 200.
                
> [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse
> ----------------------------------------------------------------------
>
>                 Key: CB-2183
>                 URL: https://issues.apache.org/jira/browse/CB-2183
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: Tested on iOS 5.1 and 6.0
>            Reporter: William Wong
>            Assignee: Shazron Abdullah
>            Priority: Critical
>              Labels: File, FileTransfer
>             Fix For: 2.4.0
>
>
> When FileTransfer.download() is downloading a file from file:///, NSURLConnection did
not return with NSHTTPURLResponse. This will fail for apps that copy files from www/, e.g.
apps that initialize its database from a pre-built cache packaged in IPA.
> In CB-1600 (fixed in 2.2.0), the fix assumes all response must be NSHTTPURLResponse.
So when FileTransfer.download() is downloading from a file:/// URL (e.g. copying file from
www/ folder to Documents/), FileTransfer assumed the download operation failed and returned
403.
> Tested if we comment out CB-1600, downloading from file:/// works again.
> We need to find out a better fix instead of commenting out CB-1600.
> According to http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html#//apple_ref/doc/uid/10000165i,
URL of file:/// is supported.
> You can test FileTransfer.download() by calling it with "encodeURI(document.location.href)"
as the "source" parameter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message