Chromium Code Reviews| Index: net/http/http_util.cc |
| diff --git a/net/http/http_util.cc b/net/http/http_util.cc |
| index f1e5143e701a5334499dccc9a814ae4c96d2023b..1e2c120692c695e26af7a351bda02356ee773f25 100644 |
| --- a/net/http/http_util.cc |
| +++ b/net/http/http_util.cc |
| @@ -739,6 +739,19 @@ bool HttpUtil::HasStrongValidators(HttpVersion version, |
| return ((date - last_modified).InSeconds() >= 60); |
|
bengr
2015/12/03 17:42:21
I'd add a comment here that a Last-Modified header
jamartin (wrong)
2015/12/08 16:58:18
Done.
|
| } |
| +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 |