Chromium Code Reviews| Index: net/http/http_request_headers.cc |
| diff --git a/net/http/http_request_headers.cc b/net/http/http_request_headers.cc |
| index 004d0659512c62ec3d35b40d1abd6926171cfe8b..c2eee59af95f8408a9d11ad774986e302270175b 100644 |
| --- a/net/http/http_request_headers.cc |
| +++ b/net/http/http_request_headers.cc |
| @@ -241,8 +241,7 @@ HttpRequestHeaders::HeaderVector::iterator |
| HttpRequestHeaders::FindHeader(const base::StringPiece& key) { |
| for (HeaderVector::iterator it = headers_.begin(); |
| it != headers_.end(); ++it) { |
| - if (key.length() == it->key.length() && |
|
Nico
2015/07/08 21:58:24
Don't you need this check in case one string piece
brettw
2015/07/08 22:35:17
I don't follow. the new base one deals exclusively
Nico
2015/07/08 22:44:33
Yes, I confused myself here.
|
| - !base::strncasecmp(key.data(), it->key.data(), key.length())) |
| + if (base::EqualsCaseInsensitiveASCII(key, it->key)) |
| return it; |
| } |
| @@ -253,8 +252,7 @@ HttpRequestHeaders::HeaderVector::const_iterator |
| HttpRequestHeaders::FindHeader(const base::StringPiece& key) const { |
| for (HeaderVector::const_iterator it = headers_.begin(); |
| it != headers_.end(); ++it) { |
| - if (key.length() == it->key.length() && |
| - !base::strncasecmp(key.data(), it->key.data(), key.length())) |
|
Nico
2015/07/08 21:58:24
likewise
|
| + if (base::EqualsCaseInsensitiveASCII(key, it->key)) |
| return it; |
| } |