Index: content/browser/download/download_resource_handler.cc |
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc |
index 3e460b3f0698b13c232cb999f30edfc581a76a02..9f00ef660b53a4a43cecf1eb89f6eabde3e3cb71 100644 |
--- a/content/browser/download/download_resource_handler.cc |
+++ b/content/browser/download/download_resource_handler.cc |
@@ -168,12 +168,15 @@ bool DownloadResourceHandler::OnResponseStarted( |
// Get the last modified time and etag. |
const net::HttpResponseHeaders* headers = request()->response_headers(); |
if (headers) { |
- // TODO(asanka): Only store these if headers->HasStrongValidators() is true. |
- // See RFC 2616 section 13.3.3. |
- if (!headers->EnumerateHeader(NULL, "Last-Modified", &info->last_modified)) |
- info->last_modified.clear(); |
- if (!headers->EnumerateHeader(NULL, "ETag", &info->etag)) |
- info->etag.clear(); |
+ if (headers->HasStrongValidators()) { |
+ // If we don't have strong validators as per RFC 2616 section 13.3.3, then |
+ // we neither store nor use them for range requests. |
+ if (!headers->EnumerateHeader(NULL, "Last-Modified", |
+ &info->last_modified)) |
+ info->last_modified.clear(); |
+ if (!headers->EnumerateHeader(NULL, "ETag", &info->etag)) |
+ info->etag.clear(); |
+ } |
int status = headers->response_code(); |
if (2 == status / 100 && status != net::HTTP_PARTIAL_CONTENT) { |