From 6ead8f6771fdc80d3ac67e174066b674f688b2d6 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Fri, 23 Apr 2010 15:57:58 -0700 Subject: 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 --- core/java/android/net/http/Request.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/java/android/net/http/Request.java b/core/java/android/net/http/Request.java index f1ebb4793ac1..8c0d5032d5ce 100644 --- a/core/java/android/net/http/Request.java +++ b/core/java/android/net/http/Request.java @@ -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(); -- cgit v1.2.3-59-g8ed1b