diff options
| author | Grace Kloba <klobag@google.com> | 2010-04-23 15:57:58 -0700 |
|---|---|---|
| committer | Grace Kloba <klobag@google.com> | 2010-04-23 15:57:58 -0700 |
| commit | 6ead8f6771fdc80d3ac67e174066b674f688b2d6 (patch) | |
| tree | c9c491670c98713d0f0ebfcf96d757cbad3f5321 /core/java | |
| parent | 7b88af679a9a3b5737343bb996ef392b76d19e73 (diff) | |
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
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/net/http/Request.java | 5 |
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(); |
