From 3ff4c66db0a8abe7b54bba18a034e4219c24d6a7 Mon Sep 17 00:00:00 2001 From: didlich Date: Tue, 29 Mar 2016 19:12:20 +0200 Subject: [PATCH] fix cordova file-transfer plugin - upload method same as in issue #5435 for download method --- cordova/cordova-tests.ts | 2 +- cordova/plugins/FileTransfer.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cordova/cordova-tests.ts b/cordova/cordova-tests.ts index d0e6e6889..7e97305a2 100644 --- a/cordova/cordova-tests.ts +++ b/cordova/cordova-tests.ts @@ -192,7 +192,7 @@ file.upload('cdvfile://localhost/persistent/path/to/downloads/', console.error('Failed with exception ' + err.exception); } }, - { headers: null, httpMethod: "PUT" }, + { headers: {"X-Email": "user@mail.com", 'X-Token': "asdf3w234"}, httpMethod: "PUT" }, true); file.abort(); diff --git a/cordova/plugins/FileTransfer.d.ts b/cordova/plugins/FileTransfer.d.ts index 140973cd5..40829668a 100644 --- a/cordova/plugins/FileTransfer.d.ts +++ b/cordova/plugins/FileTransfer.d.ts @@ -93,7 +93,7 @@ interface FileUploadOptions { /** Whether to upload the data in chunked streaming mode. Defaults to true. */ chunkedMode?: boolean; /** A map of header name/header values. Use an array to specify more than one value. */ - headers?: Object[]; + headers?: Object; } /** Optional parameters for download method. */