Apply Content-Range and Content-Length headers to resumable upload request.
This commit is contained in:
parent
a7aec6bfbc
commit
b94a636542
1 changed files with 6 additions and 1 deletions
|
@ -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()) {
|
||||||
request.header(header.getKey(), header.getValue());
|
if (!header.getKey().equalsIgnoreCase("host")) {
|
||||||
|
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…
Add table
Reference in a new issue