mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-07 21:38:33 +00:00
Apply Content-Range and Content-Length headers to resumable upload request.
This commit is contained in:
parent
a7aec6bfbc
commit
b94a636542
@ -1128,13 +1128,18 @@ public class PushServiceSocket {
|
||||
Request.Builder request = new Request.Builder().url(urlBuilder.build())
|
||||
.post(RequestBody.create(null, ""));
|
||||
for (Map.Entry<String, String> header : headers.entrySet()) {
|
||||
request.header(header.getKey(), header.getValue());
|
||||
if (!header.getKey().equalsIgnoreCase("host")) {
|
||||
request.header(header.getKey(), header.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
if (connectionHolder.getHostHeader().isPresent()) {
|
||||
request.header("host", connectionHolder.getHostHeader().get());
|
||||
}
|
||||
|
||||
request.addHeader("Content-Length", "0");
|
||||
request.addHeader("Content-Type", "application/octet-stream");
|
||||
|
||||
Call call = okHttpClient.newCall(request.build());
|
||||
|
||||
synchronized (connections) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user