mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-08 07:28:34 +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())
|
Request.Builder request = new Request.Builder().url(urlBuilder.build())
|
||||||
.post(RequestBody.create(null, ""));
|
.post(RequestBody.create(null, ""));
|
||||||
for (Map.Entry<String, String> header : headers.entrySet()) {
|
for (Map.Entry<String, String> header : headers.entrySet()) {
|
||||||
|
if (!header.getKey().equalsIgnoreCase("host")) {
|
||||||
request.header(header.getKey(), header.getValue());
|
request.header(header.getKey(), header.getValue());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (connectionHolder.getHostHeader().isPresent()) {
|
if (connectionHolder.getHostHeader().isPresent()) {
|
||||||
request.header("host", connectionHolder.getHostHeader().get());
|
request.header("host", connectionHolder.getHostHeader().get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
request.addHeader("Content-Length", "0");
|
||||||
|
request.addHeader("Content-Type", "application/octet-stream");
|
||||||
|
|
||||||
Call call = okHttpClient.newCall(request.build());
|
Call call = okHttpClient.newCall(request.build());
|
||||||
|
|
||||||
synchronized (connections) {
|
synchronized (connections) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user