CB-10974 Cordova file transfer Content-Length header problem

Fixed iOS logic to not to include Content-Length when chunkedMode=true
Fixed Android logic preventing chunkedMode to be enabled for http uploads
Added tests for chunkedMode
Documented chunkedMode not supported on Windows
Documented Uploading of an empty file is not supported for chunkedMode=true and multipart=false for iOS, pended the corresponding test
This commit is contained in:
daserge
2016-04-13 17:24:57 +03:00
parent 6ad92c92ab
commit 9347606dd3
5 changed files with 102 additions and 5 deletions
+1 -1
View File
@@ -426,7 +426,7 @@ public class FileTransfer extends CordovaPlugin {
// setFixedLengthStreamingMode causes and OutOfMemoryException on pre-Froyo devices.
// http://code.google.com/p/android/issues/detail?id=3164
// It also causes OOM if HTTPS is used, even on newer devices.
boolean useChunkedMode = chunkedMode && (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO || useHttps);
boolean useChunkedMode = chunkedMode || (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO || useHttps);
useChunkedMode = useChunkedMode || (fixedLength == -1);
if (useChunkedMode) {