Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ead8f67 authored by Grace Kloba's avatar Grace Kloba
Browse files

Restrict the range request to the servers claiming

that they accept ranges. This may be too restrict as
the spec says the server MAY set this in the response
header. But this is the last minute change made in
https://android-git.corp.google.com/g/#change,49444
I think it is safer to be conservative.

Fix http://b/issue?id=2616477
parent 7b88af67
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -268,7 +268,10 @@ class Request {
        if (hasBody)
            entity = httpClientConnection.receiveResponseEntity(header);

        boolean supportPartialContent = v.greaterEquals(HttpVersion.HTTP_1_1);
        // restrict the range request to the servers claiming that they are
        // accepting ranges in bytes
        boolean supportPartialContent = "bytes".equalsIgnoreCase(header
                .getAcceptRanges());

        if (entity != null) {
            InputStream is = entity.getContent();