diff options
author | vkuzkokov@chromium.org <vkuzkokov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 19:20:34 +0000 |
---|---|---|
committer | vkuzkokov@chromium.org <vkuzkokov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 19:20:34 +0000 |
commit | bbae90fd45cd15ead43c5b91656bc838405b309f (patch) | |
tree | ef52b4afecf13a30cd6995c07034be71099b8ac3 /net/server/http_server_request_info.cc | |
parent | 7dfcda1c8c3523433d052d3f6bd9031bd3aab7bf (diff) | |
download | chromium_src-bbae90fd45cd15ead43c5b91656bc838405b309f.zip chromium_src-bbae90fd45cd15ead43c5b91656bc838405b309f.tar.gz chromium_src-bbae90fd45cd15ead43c5b91656bc838405b309f.tar.bz2 |
HttpServer: Handling of multiple header fields with the same name and multiple values of "Connection".
BUG=370437
Review URL: https://codereview.chromium.org/274813002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/server/http_server_request_info.cc')
-rw-r--r-- | net/server/http_server_request_info.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/server/http_server_request_info.cc b/net/server/http_server_request_info.cc index 67965f2..8b65bee 100644 --- a/net/server/http_server_request_info.cc +++ b/net/server/http_server_request_info.cc @@ -22,4 +22,21 @@ std::string HttpServerRequestInfo::GetHeaderValue( return std::string(); } +bool HttpServerRequestInfo::HasHeaderValue( + const std::string& header_name, + const std::string& header_value) const { + DCHECK_EQ(StringToLowerASCII(header_value), header_value); + std::string complete_value = GetHeaderValue(header_name); + StringToLowerASCII(&complete_value); + std::vector<std::string> value_items; + Tokenize(complete_value, ",", &value_items); + for (std::vector<std::string>::iterator it = value_items.begin(); + it != value_items.end(); ++it) { + base::TrimString(*it, " \t", &*it); + if (*it == header_value) + return true; + } + return false; +} + } // namespace net |