Add Accept-Ranges header to partial get requests

Fixes #66.
pull/124/head
Andrew Gaul 2016-01-15 22:36:00 -08:00
rodzic f595a000ba
commit 542c9b8112
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -1260,11 +1260,14 @@ final class S3ProxyHandler extends AbstractHandler {
response.setStatus(status);
addMetadataToResponse(response, blob.getMetadata());
// TODO: handles only a single range due to jclouds limitations
Collection<String> contentRanges =
blob.getAllHeaders().get(HttpHeaders.CONTENT_RANGE);
if (!contentRanges.isEmpty()) {
response.addHeader(HttpHeaders.CONTENT_RANGE,
contentRanges.iterator().next());
response.addHeader(HttpHeaders.ACCEPT_RANGES,
"bytes");
}
try (InputStream is = blob.getPayload().openStream();