cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daserge <>
Subject [GitHub] cordova-plugin-file-transfer pull request: uploadResponse encoding...
Date Mon, 26 Oct 2015 08:55:52 GMT
Github user daserge commented on a diff in the pull request:
    --- Diff: src/ios/CDVFileTransfer.m ---
    @@ -552,6 +552,8 @@ - (void)connectionDidFinishLoading:(NSURLConnection*)connection
         if (self.direction == CDV_TRANSFER_UPLOAD) {
             uploadResponse = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding];
    +        if (uploadResponse == nil)
    +            uploadResponse = [[NSString alloc] initWithData: self.responseData encoding:NSISOLatin1StringEncoding];
    --- End diff --
    @codable, I want to remind you to sign ICLA - please do it so that your code could be
pulled in:
    You can use [cordova-plugin-test-framework](
for testing; please find the workflow described in [this comment](
    I used the following extra test for this PR (its the same as `filetransfer.spec.18` just
with updated url):
                    it("filetransfer.spec.18b should be able to upload a file and handle non-UTF8
encoded response", function (done) {
                        var fileURL = SERVER + '/upload_non_utf';                        
                        var uploadWin = function (uploadResult) {                        
                            if (cordova.platformId === 'ios') {                          
                                expect(uploadResult.headers).toBeDefined('Expected headers
to be defined.');                                  
content-type header to be defined.');      
                        // NOTE: removing uploadOptions cause Android to timeout         
                        transfer.upload(localFilePath, fileURL, uploadWin, unexpectedCallbacks.httpFail,
                    }, UPLOAD_TIMEOUT);                                                  
    To test the custom [file-transfer endpoint](
I used Heroku (probably a local node server could also be used).
    To point the tests to another endpoint change [these lines](

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message