| Index: net/http/http_cache_transaction.cc
|
| ===================================================================
|
| --- net/http/http_cache_transaction.cc (revision 35555)
|
| +++ net/http/http_cache_transaction.cc (working copy)
|
| @@ -548,6 +548,11 @@
|
| if (!entry_->disk_entry->GetDataSize(kResponseContentIndex))
|
| return false;
|
|
|
| + if (response_.headers->GetContentLength() <= 0 ||
|
| + response_.headers->HasHeaderValue("Accept-Ranges", "none") ||
|
| + !response_.headers->HasStrongValidators())
|
| + return false;
|
| +
|
| truncated_ = true;
|
| target_state_ = STATE_NONE;
|
| next_state_ = STATE_CACHE_WRITE_TRUNCATED_RESPONSE;
|
| @@ -1142,7 +1147,7 @@
|
| custom_request_->extra_headers.append("\r\n");
|
| // For byte-range requests, make sure that we use only one way to validate
|
| // the request.
|
| - if (partial_.get())
|
| + if (partial_.get() && !partial_->IsCurrentRangeCached())
|
| return true;
|
| }
|
|
|
| @@ -1224,7 +1229,10 @@
|
| return true;
|
| }
|
|
|
| - // 304 is not expected here, but we'll spare the entry.
|
| + // 304 is not expected here, but we'll spare the entry (unless it was
|
| + // truncated).
|
| + if (truncated_)
|
| + failure = true;
|
| }
|
|
|
| if (failure) {
|
|
|