Hi guys,

There were several user reports recently about the upload failures caused by 
the lack of Content-Length header in case of HTTPS uploads.
This issue is caused by the FileTransfer code, which forces chunkedMode=true 
for HTTPS uploads due to possible OutOfMemoryException.
As a solution I've send a PR [1], which does not touch chunkedMode if it was 
specified as false in the UploadOptions.

Do you think this a correct solution?

According to the HTTP specification [2]:

Ø  Messages MUST NOT include both a Content-Length header field and a 
non-identity transfer-coding. If the message does include a non- identity 
transfer-coding, the Content-Length MUST be ignored.



So including a Content-Length for the chunkedMode=true case would be wrong.

Furthermore we don't control the underlying implementation so can't define the 
summary length of chunks beforehand.



[1]: https://github.com/apache/cordova-plugin-file-transfer/pull/169

[2]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4

Please let me know if you have any questions or considerations.

Best regards,
Sergey Shakhnazarov.


Reply via email to