Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(902)

Unified Diff: webkit/appcache/appcache_url_request_job.cc

Issue 2876040: Fix a regression with satisfying range requests out of the appcache and add a... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/appcache/appcache_url_request_job.h ('k') | webkit/appcache/appcache_url_request_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_url_request_job.cc
===================================================================
--- webkit/appcache/appcache_url_request_job.cc (revision 51565)
+++ webkit/appcache/appcache_url_request_job.cc (working copy)
@@ -9,6 +9,7 @@
#include "base/message_loop.h"
#include "base/string_util.h"
#include "net/base/net_errors.h"
+#include "net/http/http_request_headers.h"
#include "net/http/http_util.h"
#include "net/url_request/url_request_status.h"
@@ -243,13 +244,18 @@
}
void AppCacheURLRequestJob::SetExtraRequestHeaders(
- const std::string& headers) {
+ const net::HttpRequestHeaders& headers) {
+ std::string value;
+ std::vector<net::HttpByteRange> ranges;
+ if (!headers.GetHeader(net::HttpRequestHeaders::kRange, &value) ||
+ !net::HttpUtil::ParseRangeHeader(value, &ranges)) {
+ return;
+ }
+
// If multiple ranges are requested, we play dumb and
// return the entire response with 200 OK.
- std::vector<net::HttpByteRange> ranges;
- if (!net::HttpUtil::ParseRanges(headers, &ranges) || (ranges.size() > 1U))
- return;
- range_requested_ = ranges[0];
+ if (ranges.size() == 1U)
+ range_requested_ = ranges[0];
}
} // namespace appcache
« no previous file with comments | « webkit/appcache/appcache_url_request_job.h ('k') | webkit/appcache/appcache_url_request_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698