mirror of
https://github.com/apache/cordova-plugin-file-transfer.git
synced 2026-06-05 00:00:35 +08:00
CB-9624: There's a difference between what's being passed in and what should actually be sent to the File Transfer plugin
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user