Adds a boundary between media and data

This commit is contained in:
stom79 2018-04-23 13:29:03 +02:00
parent ec2dd65e4b
commit e9c5f7d9da
1 changed files with 3 additions and 2 deletions

View File

@ -708,7 +708,7 @@ public class HttpsConnection {
lengthSentHeader += 2 * (lineEnd).getBytes().length;
}
int lengthSent = lengthSentHeader + lengthSentAvatar;
int lengthSent = lengthSentHeader + lengthSentAvatar + (twoHyphens + boundary + twoHyphens + lineEnd).getBytes().length;
if (proxy != null)
httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
else
@ -742,7 +742,8 @@ public class HttpsConnection {
OutputStream outputStream = httpsURLConnection.getOutputStream();
outputStream.write(postDataBytes);
if( lengthSent > 0)
outputStream.write((twoHyphens + boundary + twoHyphens + lineEnd).getBytes("UTF-8"));
if(lengthSentAvatar > 0){
DataOutputStream request = new DataOutputStream(outputStream);
int totalSize = pixelsAvatar.length;