fix: #372 [Bug] Android: malformed empty multipart requests

This commit is contained in:
Sefa Ilkimen
2021-07-07 03:16:43 +02:00
parent c081060a9e
commit badf6dcdc2
2 changed files with 12 additions and 4 deletions
@@ -189,8 +189,9 @@ abstract class CordovaHttpBase implements Runnable {
}
// prevent sending malformed empty multipart requests (#372)
if (buffers.length == 0) {
request.contentType(HttpRequest.CONTENT_TYPE_FORM);
if (buffers.length() == 0) {
request.contentType("multipart/form-data; boundary=00content0boundary00");
request.send("\r\n--00content0boundary00--\r\n");
}
}
}