summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Grace Kloba <klobag@google.com> 2010-04-23 16:19:22 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2010-04-23 16:19:22 -0700
commit87782f2bdfc679fd8f3c7ae7cd72bfd0e71efdc6 (patch)
tree945108ae8b5317e8eccab889f76127e7fbd37a03
parent29355534384ee24bfe9a3bc97d7664dbe478b4fb (diff)
parent6ead8f6771fdc80d3ac67e174066b674f688b2d6 (diff)
Merge "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." into froyo
-rw-r--r--core/java/android/net/http/Request.java5
1 files changed, 4 insertions, 1 deletions
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();