You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2015/09/08 23:04:10 UTC

cordova-plugin-file-transfer git commit: CB-9624: There's a difference between what's being passed in and what should actually be sent to the File Transfer plugin

Repository: cordova-plugin-file-transfer
Updated Branches:
  refs/heads/master 8fcdb1aa3 -> a4a448095


CB-9624: There's a difference between what's being passed in and what should actually be sent to the File Transfer plugin


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/a4a44809
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/a4a44809
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/a4a44809

Branch: refs/heads/master
Commit: a4a448095c02a658c2e1fdcff267d5d3de5785f3
Parents: 8fcdb1a
Author: Joe Bowser <bo...@apache.org>
Authored: Tue Sep 8 14:04:04 2015 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Tue Sep 8 14:04:04 2015 -0700

----------------------------------------------------------------------
 src/android/FileTransfer.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/a4a44809/src/android/FileTransfer.java
----------------------------------------------------------------------
diff --git a/src/android/FileTransfer.java b/src/android/FileTransfer.java
index 22a1ed7..610ffe9 100644
--- a/src/android/FileTransfer.java
+++ b/src/android/FileTransfer.java
@@ -204,7 +204,7 @@ public class FileTransfer extends CordovaPlugin {
                  * arbitrary characters, but we donon- not do that encoding here.
                  */
                 String headerKey = iter.next().toString();
-                headerKey = headerKey.replaceAll("\\n","")
+                String cleanHeaderKey = headerKey.replaceAll("\\n","")
                         .replaceAll("\\s+","")
                         .replaceAll(":", "")
                         .replaceAll("[^\\x20-\\x7E]+", "");
@@ -224,7 +224,8 @@ public class FileTransfer extends CordovaPlugin {
                     headerValues.put(finalValue);
                 }
 
-                connection.setRequestProperty(headerKey, headerValues.getString(0));
+                //Use the clean header key, not the one that we passed in
+                connection.setRequestProperty(cleanHeaderKey, headerValues.getString(0));
                 for (int i = 1; i < headerValues.length(); ++i) {
                     connection.addRequestProperty(headerKey, headerValues.getString(i));
                 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org