| Index: net/http/http_util.cc
|
| diff --git a/net/http/http_util.cc b/net/http/http_util.cc
|
| index 6192c894145db1310e9668fbcfaebc89a260065f..e8d7a1deb74ee62e015e9dcba5bd442352e45c33 100644
|
| --- a/net/http/http_util.cc
|
| +++ b/net/http/http_util.cc
|
| @@ -761,9 +761,24 @@ bool HttpUtil::HasStrongValidators(HttpVersion version,
|
| if (!base::Time::FromString(date_header.c_str(), &date))
|
| return false;
|
|
|
| + // Last-Modified is implicitly weak unless it is at least 60 seconds before
|
| + // the Date value.
|
| return ((date - last_modified).InSeconds() >= 60);
|
| }
|
|
|
| +bool HttpUtil::HasValidators(HttpVersion version,
|
| + const std::string& etag_header,
|
| + const std::string& last_modified_header) {
|
| + if (version < HttpVersion(1, 0))
|
| + return false;
|
| +
|
| + base::Time last_modified;
|
| + if (base::Time::FromString(last_modified_header.c_str(), &last_modified))
|
| + return true;
|
| +
|
| + return version >= HttpVersion(1, 1) && !etag_header.empty();
|
| +}
|
| +
|
| // Functions for histogram initialization. The code 0 is put in the map to
|
| // track status codes that are invalid.
|
| // TODO(gavinp): Greatly prune the collected codes once we learn which
|
|
|