From e75e8afa0cf126ca22e403874a22249d51b86219 Mon Sep 17 00:00:00 2001 From: "rvargas@google.com" Date: Tue, 3 Nov 2009 00:04:20 +0000 Subject: Http cache: Always preserve extra headers when dealing with byte range requests. BUG=25755 TEST=unittests Review URL: http://codereview.chromium.org/339088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30773 0039d316-1c4b-4281-b951-d872f2087c98 --- net/http/http_cache.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'net/http/http_cache.cc') diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 230b224..0c3783d 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -843,12 +843,13 @@ void HttpCache::Transaction::SetRequest(LoadLog* load_log, if (range_found && !(effective_load_flags_ & LOAD_DISABLE_CACHE)) { partial_.reset(new PartialData); - if (partial_->Init(request_->extra_headers, new_extra_headers)) { + if (partial_->Init(request_->extra_headers)) { // We will be modifying the actual range requested to the server, so // let's remove the header here. custom_request_.reset(new HttpRequestInfo(*request_)); request_ = custom_request_.get(); custom_request_->extra_headers = new_extra_headers; + partial_->SetHeaders(new_extra_headers); } else { // The range is invalid or we cannot handle it properly. LOG(WARNING) << "Invalid byte range found."; @@ -946,6 +947,7 @@ int HttpCache::Transaction::BeginPartialCacheValidation() { } else { // The request is not for a range, but we have stored just ranges. partial_.reset(new PartialData()); + partial_->SetHeaders(request_->extra_headers); if (!custom_request_.get()) { custom_request_.reset(new HttpRequestInfo(*request_)); request_ = custom_request_.get(); -- cgit v1.1